public abstract class FileProcessor extends Object
| Modifier and Type | Field and Description |
|---|---|
protected boolean |
isVerbose
If this is true, verbose output will be generated.
|
| Constructor and Description |
|---|
FileProcessor(FilenameFilter filter,
boolean verbosity)
Creates a Fileprocessor that overwrites all output files, and does not
fail fast.
|
FileProcessor(FilenameFilter filter,
boolean failFast,
boolean overwrite,
boolean verbose) |
FileProcessor(String extension,
boolean verbosity)
Creates a Fileprocessor that overwrites all output files, and does not
fail fast.
|
| Modifier and Type | Method and Description |
|---|---|
static FilenameFilter |
getExtensionFilter(String filenameExt) |
boolean |
process(File in,
File out) |
protected abstract void |
processFile(File in,
File out)
Called to process a single file.
|
protected final boolean isVerbose
public FileProcessor(FilenameFilter filter, boolean failFast, boolean overwrite, boolean verbose)
filter - used to select files and/or subdirectories.failFast - if true, terminates at the first error (otherwise,
continues with the next file).overwrite - if false, will not overwrite existing output files (That
particular input and output file will be skipped).verbose - if true, generates verbose output.public FileProcessor(FilenameFilter filter, boolean verbosity)
filter - used to select files and/or subdirectories.public FileProcessor(String extension, boolean verbosity)
extension - the file extension to filter for. if this is null, all
files and subdirectories in a directory will be processed recursively.getExtensionFilter(String extension)public static FilenameFilter getExtensionFilter(String filenameExt)
filenameExt - the filename extension to accept. If null, all files
are accepted.public boolean process(File in, File out)
in - the input file or directoryout - if the input is a directory, then this must be the output
directory. Otherwise, this is the output file.protected abstract void processFile(File in, File out) throws Exception
in - the input file. This is never a directory.out - the output file. If this file exists and overwriting is not
permitted, then this method is never called.Exception - if this class is set to fail fast then any
exception thrown will cause all execution to halt. If this class does not
fail fast, then the exception will be reported and execution will
continue with the next file.Copyright © 2001-2012 Apache Software Foundation. All Rights Reserved.