code: public static void multiFromDirectory(File dir,
                                            String ingestFormat,
                                            FedoraAPIAMTOM targetRepoAPIA,
                                            FedoraAPIMMTOM targetRepoAPIM,
                                            String logMessage,
                                            PrintStream log,
                                            IngestCounter c) throws Exception {
          File[] files = dir.listFiles();
          if (files == null) {
              throw new RuntimeException("Could not read files from directory "
                      + dir.getPath());
          }
  
          Arrays.sort(files, _FILE_COMPARATOR);
          for (File element : files) {
              if (!element.isHidden() && !element.getName().startsWith(".")) {
                  if (element.isDirectory()) {
                      multiFromDirectory(element,
                                         ingestFormat,
                                         targetRepoAPIA,
                                         targetRepoAPIM,
                                         logMessage,
                                         log,
                                         c);
                  } else {
                      try {
                          String pid =
                                  oneFromFile(element,
                                              ingestFormat,
                                              targetRepoAPIA,
                                              targetRepoAPIM,
                                              logMessage);
                          c.successes++;
                          IngestLogger.logFromFile(log, element, pid);
                      } catch (Exception e) {
                          // failed... just log it and continue
                          c.failures++;
                          IngestLogger.logFailedFromFile(log, element, e);
                      }
                  }
              }
          }
      }
docs: *************************************************************************
  Ingest from directory
  ************************************************************************