code: private List<File> listFiles(File file, List<File> files) {
          File[] children = file.listFiles();
          
          if (children != null) {
              for (File child : children) {
                  files.add(child);
                  listFiles(child, files);
              }
          }
          
          return files;
      }
docs: Recurse over entire directory subtree, adding entries to the file list.
  
  @param file Parent file.
  @param files List to receive files.
  @return The updated file list.