code: private static File[] getAllFiles(String dirName) {
  
      File dir = new File(dirName);
  
      File[] files = dir.listFiles(); // returns files and folders
  
      if (files != null) {
        List<File> filteredFiles = new ArrayList<File>();
        for (File file : files) {
  
          if (file.isFile()) {
            filteredFiles.add(file);
          }
        }
        return filteredFiles.toArray(new File[filteredFiles.size()]);
      } else {
        System.out.println(dirName + " does not denote a valid directory!");
        return new File[0];
      }
    }
docs: This method returns the Files found in the given directory
  
  @param dirName - ex. "./path/to/directory/" *make sure you have the '/' on the end
  @return File[] - an array of files