public static List<String> fileNameWildCardSearch(List<File> files,Date start,Date end) throws IOException {
  List<String> nameList=new ArrayList<>();
  for (  File f : files) {
    logger.debug("file path: " + f.getAbsolutePath());
  }
  if (!files.isEmpty()) {
    Collections.sort(files,new LogFileComparator());
    for (    File file : files) {
      if (fileInTimeRange(file,start,end) < 0) {
        continue;
      }
 else       if ((fileInTimeRange(file,start,end) == 0)) {
        String name=file.getCanonicalPath();
        nameList.add(name);
      }
 else {
        String name=file.getCanonicalPath();
        nameList.add(name);
        break;
      }
    }
  }
  logger.debug("after filter fileNames {}",nameList);
  return nameList;
}

public static List < String > fileNameWildCardSearch ( List < File > files , Date start , Date end ) throws IOException { List < String > nameList = new ArrayList < > ( ) ; for ( File f : files ) { logger . debug ( "file path: " + f . getAbsolutePath ( ) ) ; } if ( ! files . isEmpty ( ) ) { Collections . sort ( files , new LogFileComparator ( ) ) ; for ( File file : files ) { if ( fileInTimeRange ( file , start , end ) < 0 ) { continue ; } else if ( ( fileInTimeRange ( file , start , end ) == 0 ) ) { String name = file . getCanonicalPath ( ) ; nameList . add ( name ) ; } else { String name = file . getCanonicalPath ( ) ; nameList . add ( name ) ; break ; } } } logger . debug ( "after filter fileNames {}" , nameList ) ; return nameList ; }
find files with regex matching and time range matching return a list of files sorted by last modification time .
