Read remote file in java which needs username and password

Viewed 56378

I am trying to read a remote file in java

File f = new File("//192.168.1.120/home/hustler/file.txt");

The remote machine needs a Username and Password to allow me to access the file.

Is there a way I could pass the parameters through the java code and read the file?

4 Answers
Related