code: public static void listAllFiles(final Set<String> setOfPaths, final String inputPath) {
          if (inputPath == null) {
              return;
          }
          File[] files = new File(inputPath).listFiles();
          if (files == null) {
              return;
          }
          for (File file : files) {
              if (file.isDirectory()) {
                  listAllFiles(setOfPaths, file.getAbsolutePath());
              } else if (file.getName().contains("_train.dat")) {
                  setOfPaths.add(file.getAbsolutePath().replaceAll("_train.dat", ""));
              }
          }
      }
docs: List all files at a certain path.
  
  @param setOfPaths the set of files at a certain path
  @param inputPath the path to check