*
ToolsTools
There are two tools available for processing files and directories:
Each tool also has a main method so that it can be called directly. It should be noted that each processor makes use of a XML configured processor to configure the processor with handlers, tags and delimiters for the parser.
*
FileProcessor
Process an input file containing hoglet markup and write to the output file.
 
Usage


> java org.hoglet.tools.FileProcessor [xml config file] [input file] [output file] [overwrite]


Supports the following arguments:
ArgumentOptionalDescription
xml config fileNoIs the full path to the config file for the tag, handlers and delimiters that the parser should use for processing.
input fileNoThe input file that contains the hoglet markup.
output fileNoThe output file.
overwriteYesShould be either: true or false. If true then the processor will overwrite the output file if it already exists. If false and the output file already exists then the output file is not overwritten and an error is returned.
 
Example
This assumes that you are running hoglet from the install directory using the default tag handlers config file.

> java org.hoglet.tools.FileProcessor data/tag-handlers.xml /home/me/myfile.txt /home/me/myfile.html true
*
DirectoryProcessor
Process files in an input directory containing hoglet markup and write to the output directory. The files to be processed are limited by a file extension, output files are given the same name as the input file but assigned the specified file extension.

If required the processor will recurse down the directory tree, processing each directory.
 
Usage


> java org.hoglet.tools.DirectoryProcessor [xml config file] [input directory] [input file extension] [output directory] [output file extension] [overwrite] [recurse directories]


Supports the following arguments:
ArgumentOptionalDescription
xml config fileNoIs the full path to the config file for the tag, handlers and delimiters that the parser should use for processing.
input directoryNoThe input directory to process.
input file extensionNoLimit the files to process to those with this file extension.
output directoryNoThe output directory to process.
output file extensionNoGive the processed file this file extension. The original file extension is stripped, i.e. index.txt would become index.html.
overwriteYesShould be either: true or false. If true then the processor will overwrite the output file if it already exists. If false and the output file already exists then the output file is not overwritten and an error is returned.
recurse directoriesYesShould be either: true or false. If true then the processor will recurse down the directory tree (starting at the input directory of course) and process each directory. If false then only the input directory will be processed.
 
Example
This assumes that you are running hoglet from the install directory using the default tag handlers config file.

> java org.hoglet.tools.DirectoryProcessor data/tag-handlers.xml /home/me txt /home/me html true true
*