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
What's about similar approach, but without boxing to the Long objects:
File[] files = directory.listFiles(); Arrays.sort(files, new Comparator() { public int compare(File f1, File f2) { return Long.compare(f1.lastModified(), f2.lastModified()); } });