This week's book giveaways are in the Refactoring and Agile forums.
We're giving away four copies each of Re-engineering Legacy Software and Docker in Action and have the authors on-line!
See this thread and this one for details.
Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Checking the 'last updated' date of files on an Intranet/Internet

 
Mark Waes
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

Each month we check a number of zip files saved to an Intranet to see if they've been updated, which (usually) happens quarterly, sometimes more often.

To practice my coding skills I thought I'd write a small app which holds a list of URLs, and tests each of them to see if the file at the URL is 'newer' that the previous check performed. Currently I'm using a URLConnection object and was hoping to use its getLastModified() to determine if the file has been updated since the previous check.

I've come to test my code on various files on the Internet and is seems not all files have a value returned from getLastModified().

Is there a better way to query files in this way to see of they've been updated, or am I dependant on whether this information is present on a file by file basis?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic