code: private static File[] getAllFiles(String dirName, String regex) {
  
      File[] allFiles = getAllFiles(dirName);
  
      List<File> matchingFiles = new ArrayList<File>();
  
      for (File allFile : allFiles) {
  
        if (allFile.getName().matches(regex)) {
          matchingFiles.add(allFile);
        }
      }
  
      return matchingFiles.toArray(new File[matchingFiles.size()]);
    }
docs: This method returns the files found in the given directory matching the given regular
  expression.
  
  @param dirName - ex. "./path/to/directory/" *make sure you have the '/' on the end
  @param regex - ex. ".*.csv"
  @return File[] - an array of files