edu.northwestern.at.utils.preprocessor

## Class PreprocessDirectoryTree

- java.lang.Object
- - edu.northwestern.at.utils.preprocessor.PreprocessDirectoryTree

-     public class PreprocessDirectoryTree
      extends java.lang.Object

  PreprocessDirectoryTree -- Preprocess directory tree.

  PreprocessDirectoryTree recurses through a directory tree preprocessing all java files and copying all non-java files to a specified output directory.

  Usage:

  ``

  > java edu.northwestern.at.wordhoard.tools.PreprocessDirectoryTree sourcedirectory destinationdirectory includedirectory

  where "sourcedirectory" is the root of the directory to process; "destinationdirectory" is the root of the output directory; and "includedirectory" is the directory containing include files.

  Example:

  ``

  > java edu.northwestern.at.wordhoard.tools.PreprocessDirectoryTree /wordhoard/src /secret-src/ /wordhoard/licensetexts/

  ProcessDirectoryTree reports the number of Java files preprocessed, the number of files copied successfully, and the number of files which could not be copied. An error message is display to standard output for each file which could not be copied.

  Files whose names start with "." are not copied.

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected static java.lang.String` | `destRootName` The root of the destination directory tree.
    `protected static java.lang.String` | `includeRootName` The include file directory.
    `protected static java.lang.String` | `srcRootName` The root of the source directory tree.
    `protected static int` | `totalCopied` Total number of non-java files successfully copied.
    `protected static int` | `totalJava` Total number of java files preprocessed.
    `protected static int` | `totalJavaBad` Total number of java files which could not be preprocessed.
    `protected static int` | `totalNotCopied` Total number of non-java files which could not be copied.
    `protected static boolean` | `verbose` True to enable verbose output.

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `PreprocessDirectoryTree()`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `static void` | `main(java.lang.String[] args)` Main program for PreProcessDirectoryTree.
    `protected static void` | `runPreprocessor(java.io.File src, Preprocessor preprocessor)` Preprocess or copy files in a directory.
    `protected static void` | `usage()` Print usage.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### srcRootName

          protected static java.lang.String srcRootName

      The root of the source directory tree.

    - #### destRootName

          protected static java.lang.String destRootName

      The root of the destination directory tree.

    - #### includeRootName

          protected static java.lang.String includeRootName

      The include file directory.

    - #### totalJava

          protected static int totalJava

      Total number of java files preprocessed.

    - #### totalJavaBad

          protected static int totalJavaBad

      Total number of java files which could not be preprocessed.

    - #### totalCopied

          protected static int totalCopied

      Total number of non-java files successfully copied.

    - #### totalNotCopied

          protected static int totalNotCopied

      Total number of non-java files which could not be copied.

    - #### verbose

          protected static boolean verbose

      True to enable verbose output.

  - ### Constructor Detail

    - #### PreprocessDirectoryTree

          public PreprocessDirectoryTree()

  - ### Method Detail

    - #### runPreprocessor

          protected static void runPreprocessor(java.io.File src,
                             Preprocessor preprocessor)

      Preprocess or copy files in a directory.
      Parameters:
        `src` - Source directory.
        `preprocessor` - The preprocessor to use.

        All Java files are preprocessed. Non-java files are copied. Directories are processed recursively.

    - #### usage

          protected static void usage()

      Print usage.

    - #### main

          public static void main(java.lang.String[] args)

      Main program for PreProcessDirectoryTree.