コード例 #1
0
 /**
  * Terminate.
  *
  * <p>\u0040param filesProcessed Number of files processed. \u0040param processingTime Processing
  * time in seconds.
  */
 protected static void terminate(int filesProcessed, long processingTime) {
   System.out.println(
       "Processed "
           + Formatters.formatIntegerWithCommas(filesProcessed)
           + " files in "
           + Formatters.formatLongWithCommas(processingTime)
           + " seconds.");
 }
コード例 #2
0
  /** Process files. */
  protected static int processFiles(String[] args) {
    int result = 0;
    //  Get file name/file wildcard specs.

    String[] wildCards = new String[args.length - INITPARAMS];

    for (int i = INITPARAMS; i < args.length; i++) {
      wildCards[i - INITPARAMS] = args[i];
    }
    //  Expand wildcards to list of
    //  file names.

    String[] fileNames = FileNameUtils.expandFileNameWildcards(wildCards);

    docsToProcess = fileNames.length;

    System.out.println(
        "There are "
            + Formatters.formatIntegerWithCommas(docsToProcess)
            + " documents to process.");
    //  Process each file.

    for (int i = 0; i < fileNames.length; i++) {
      processOneFile(fileNames[i]);
    }

    return fileNames.length;
  }