Possible duplicate:
How to find the last modified file in a directory in Java?
I have a directory of files that I need to check for changes. I believe that this changed when one of the files has modifiedDate newer than the one I remember from the last check (this means that it is a cache dependency).
What would be the fastest way to find the last modified file in a Java directory?
I may be too optimistic, but I'm clearly looking for something that does not require iterating all the files.
In addition, checking the date the directory was changed is insufficient, since it only changes when the list of files inside changes, and not when one of the files themselves has just been changed.
java file
Tomalak
source share