• Post Reply Bookmark Topic Watch Topic
  • New Topic

File validation on NFS volumes  RSS feed

 
Sivalingan Babu
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I want to validate my NFS file path. I have a shared folder in remote machine and I've mapped that folder to some logical drive(Ex Z:\Test). Now I need to check of Z:\Test is valid path or not.

I've tried with the following code and found that sometimes it's not working as desired.

public boolean validatePath(String nfsPath)
{
File dir = new File(nfsPath);
boolean valid = true;
if (!dir.exists())
{
valid = dir.mkdirs();
if (valid)
{
dir.delete();
}
}
return valid;
}

some times dir.mkdirs() returning false eventhough Z:\Test is valid and accessible.

Could you please provide a workaround for this?

Thanks
 
Sivalingan Babu
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have understood the problem.

Security Manager was blocking all File I/O calls in my case
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!