I want to get a list of files in a directory, but I want to sort it such that the oldest files are first. My solution was to call File.listFiles and just resort the list ba
Function getLastModified = new Function() {
public Long apply(File file) {
return file.lastModified();
}
};
List orderedFiles = Ordering.natural().onResultOf(getLastModified).
sortedCopy(files);