public abstract class BatchProcessorOperation extends Operation
processFile(java.lang.String, java.lang.String, java.lang.String)
.Modifier and Type | Field and Description |
---|---|
private boolean |
collectErrors |
private java.util.Vector |
directoryTrees |
private java.util.Vector |
errorMessages |
private java.util.Vector |
inputFileNames |
private java.lang.String |
outputDirectory |
private boolean |
overwrite |
Constructor and Description |
---|
BatchProcessorOperation() |
Modifier and Type | Method and Description |
---|---|
void |
addDirectoryTree(java.lang.String rootDirectoryName)
Adds the argument to the list of directories to be completely
processed.
|
void |
addDirectoryTree(java.lang.String rootDirectoryName,
java.lang.String outputRootDirectoryName)
Adds the first argument to the list of directories to be completely
processed, writes all output files to the directory tree specified by
the second argument.
|
void |
addInputFileName(java.lang.String fileName)
Adds a single name to the list of file names to be processed.
|
void |
addInputFileNames(java.util.Vector fileNameList)
Adds a number of file names to the internal list of file names to be processed.
|
java.util.Vector |
getErrorMessages()
Returns a list of error messages collected during the execution of
process() . |
boolean |
getOverwrite()
Returns the current overwrite setting.
|
void |
process()
Processes all directory trees and files given to this operation,
calling
processFile(java.lang.String, java.lang.String, java.lang.String) on each file name. |
private void |
processDirectoryTree(java.lang.String fromDir,
java.lang.String toDir) |
abstract void |
processFile(java.lang.String inputDirectory,
java.lang.String inputFileName,
java.lang.String outputDirectory)
Method to be called on each file given to this operation.
|
void |
setCollectErrorMessages(boolean collectErrorMessages)
Specifies whether error messages are supposed to be collected
during the execution of
process() . |
void |
setOutputDirectory(java.lang.String outputDirectoryName)
Specifies the output directory for all single files.
|
void |
setOverwrite(boolean newValue)
Specify whether existing files are to be overwritten.
|
addProgressListener, addProgressListeners, getAbort, removeProgressListener, setAbort, setProgress, setProgress
private boolean collectErrors
private java.util.Vector directoryTrees
private java.util.Vector errorMessages
private java.util.Vector inputFileNames
private java.lang.String outputDirectory
private boolean overwrite
public void addDirectoryTree(java.lang.String rootDirectoryName)
rootDirectoryName
- name of the root of the directory tree, can be any valid directory namepublic void addDirectoryTree(java.lang.String rootDirectoryName, java.lang.String outputRootDirectoryName)
rootDirectoryName
- name of the root of the directory tree, can be any valid directory nameoutputRootDirectoryName
- name of the root of the directory tree, can be any valid directory namepublic void addInputFileName(java.lang.String fileName)
fileName
- name to be added to listpublic void addInputFileNames(java.util.Vector fileNameList)
fileNameList
- list of file names, each object in the list must be a Stringpublic java.util.Vector getErrorMessages()
process()
.public boolean getOverwrite()
public void process()
processFile(java.lang.String, java.lang.String, java.lang.String)
on each file name.private void processDirectoryTree(java.lang.String fromDir, java.lang.String toDir)
public abstract void processFile(java.lang.String inputDirectory, java.lang.String inputFileName, java.lang.String outputDirectory)
inputDirectory
- name of directory where the file to be processed residesinputFileName
- name of file to be processedoutputDirectory
- output directory for that file, need not necessarily be usedpublic void setCollectErrorMessages(boolean collectErrorMessages)
process()
.collectErrorMessages
- if true, error messages will be collected, otherwise notgetErrorMessages()
public void setOutputDirectory(java.lang.String outputDirectoryName)
outputDirectoryName
- name of output directorypublic void setOverwrite(boolean newValue)
newValue
- if true, files are overwritten, otherwise notgetOverwrite()