In Java 7 with the new I/O APIs, is there an easy way to list a directory’s content by last modified date? Basically I only need to get the file the wasn’t modified for the longest time (sort by last modified ascending, take first filename).
Share
There’s no real “easy way” to do it, but it is possible:
This will sort the files soonest modified files last.
DirectoryStreams do not iterate through subdirectories.