code: public static File[] listFilesSortedByModDate(File dir) {
          File[] backupDirFiles = dir.listFiles();
          Arrays.sort(backupDirFiles, new FileComparator());
          return backupDirFiles;
      }
docs: /*
  Provides a listing of files in a directory, sorted in order
  of most to least recent.