| Author |
java networking. Remote file's last modified date
|
Gopal Krishna
Greenhorn
Joined: Aug 31, 2002
Posts: 16
|
|
I am trying to read files on a remote machine for which i have read access. I can access these file from my windows xp m/c using am url of type file:\\machine_name\e\j2skd1.4.2\lib but when i try to access these using java.net.URL i get varying results. with Eclipse jdk when i use the below URL URL u = new URL( "file:\\\\machine_name\\e\\j2skd1.4.2\\lib"); I am able to retrieve the contents of the lib folder in an HTML format. with jdk 1.4 i get the below exception java.net.ConnectException: Connection refused: connect What is the URL format i should be using with Sun's jdk to be able to retrieve the contents of a directory ? Thank you !!
|
 |
Scott Dunbar
Ranch Hand
Joined: Sep 23, 2004
Posts: 245
|
|
|
This isn't really Java networking. The first problem you have is that file: expects forward slashes only after the colon like file:/. Next, I think (and this I can't test right now I'm afraid) that you're better off using forward slashes for all of the slashes. Windows will translate it correctly.
|
<a href="http://forums.hotjoe.com/forums/list.page" target="_blank" rel="nofollow">Java forums using Java software</a> - Come and help get them started.
|
 |
Gopal Krishna
Greenhorn
Joined: Aug 31, 2002
Posts: 16
|
|
|
Thanks Scott. This was useful.
|
 |
 |
|
|
subject: java networking. Remote file's last modified date
|
|
|