|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.myfaces.buildtools.maven2.plugin.javascript.uixtools.FileProcessor
public abstract class FileProcessor
This utility class can be used to perform some processing on input files, and write the results to corresponding output files. It supports recursing into subdirectories.
Field Summary | |
---|---|
protected boolean |
isVerbose
If this is true, verbose output will be generated. |
Constructor Summary | |
---|---|
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. |
Method Summary | |
---|---|
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. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected final boolean isVerbose
Constructor Detail |
---|
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)
Method Detail |
---|
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.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |