1

I need to search for file in the network and check if the file exist or not, I use this code:

File listOfFiles = new File ("\\\\server\\share\\TEST\\file.xml");
if (listOfFiles.exists() && listOfFiles.isFile()){
   // ...
}

but it seems that the user didn't have permission to access the network driver. I need to send the user name and password for the user who have rights to this driver, but I don't know how.

3
  • 2
    This might help stackoverflow.com/a/10600116/1469259 Commented Nov 28, 2015 at 12:57
  • related superuser.com/questions/344775/… - you can instead mount the share to a drive letter and then access it like a regular file. Credentials are then handled by the mount Commented Nov 28, 2015 at 13:05
  • the problem is I can't import NtlmPasswordAuthentication, as I said I use java in Eclipse. and share a drive conn't help because the issue is that the user who run the application is a local user and didn't have a permission to access the other driver in the network Commented Nov 29, 2015 at 8:12

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.