code: public static ArrayList<Path> listFilesByModificationTime(FileSystem fs, Path directory, long olderThan)
            throws IOException {
      ArrayList<LocatedFileStatus> fstats = new ArrayList<>();
  
      RemoteIterator<LocatedFileStatus> itr = fs.listFiles(directory, false);
      while( itr.hasNext() ) {
        LocatedFileStatus fileStatus = itr.next();
        if(olderThan>0) {
          if( fileStatus.getModificationTime()<=olderThan )
            fstats.add(fileStatus);
        }
        else {
          fstats.add(fileStatus);
        }
      }
      Collections.sort(fstats, new ModifTimeComparator() );
  
      ArrayList<Path> result = new ArrayList<>(fstats.size());
      for (LocatedFileStatus fstat : fstats) {
        result.add(fstat.getPath());
      }
      return result;
    }
docs: list files sorted by modification time that have not been modified since 'olderThan'. if
  'olderThan' is <= 0 then the filtering is disabled