• Post Reply Bookmark Topic Watch Topic
  • New Topic

java networking. Remote file's last modified date  RSS feed

 
Gopal Krishna
Greenhorn
Posts: 18
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is there a way to get the last modifed date of a file residing on a remote machine ? I tried the URL class. Could get to the file's contents but not the last modifed date of the file.

Any suggestion is very much appreciated !! Thanks.
 
Edwin Dalorzo
Ranch Hand
Posts: 961
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The URLConnection class has a getLastModified() method. Obtain a URLConnection from the URL instance by means of calling the openConnection method.

Like this:



I hope that helps!
 
Gopal Krishna
Greenhorn
Posts: 18
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Edwain,

Thank you.. THis works for me.
 
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!