ColorIndexer
public abstract class BatchProcessorOperation extends Operation
processFile(java.lang.String, java.lang.String, java.lang.String)
.Modifier and Type | Field | Description |
---|---|---|
private boolean |
collectErrors |
|
private Vector |
directoryTrees |
|
private Vector |
errorMessages |
|
private Vector |
inputFileNames |
|
private String |
outputDirectory |
|
private boolean |
overwrite |
Constructor | Description |
---|---|
BatchProcessorOperation() |
Modifier and Type | Method | Description |
---|---|---|
void |
addDirectoryTree(String rootDirectoryName) |
Adds the argument to the list of directories to be completely
processed.
|
void |
addDirectoryTree(String rootDirectoryName,
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(String fileName) |
Adds a single name to the list of file names to be processed.
|
void |
addInputFileNames(Vector fileNameList) |
Adds a number of file names to the internal list of file names to be processed.
|
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(String fromDir,
String toDir) |
|
abstract void |
processFile(String inputDirectory,
String inputFileName,
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(String outputDirectoryName) |
Specifies the output directory for all single files.
|
void |
setOverwrite(boolean newValue) |
Specify whether existing files are to be overwritten.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
addProgressListener, addProgressListeners, getAbort, removeProgressListener, setAbort, setProgress, setProgress
private boolean collectErrors
private Vector directoryTrees
private Vector errorMessages
private Vector inputFileNames
private String outputDirectory
private boolean overwrite
public void addDirectoryTree(String rootDirectoryName)
rootDirectoryName
- name of the root of the directory tree, can be any valid directory namepublic void addDirectoryTree(String rootDirectoryName, 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(String fileName)
fileName
- name to be added to listpublic void addInputFileNames(Vector fileNameList)
fileNameList
- list of file names, each object in the list must be a Stringpublic Vector getErrorMessages()
process()
.public boolean getOverwrite()
public void process()
processFile(java.lang.String, java.lang.String, java.lang.String)
on each file name.public abstract void processFile(String inputDirectory, String inputFileName, 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(String outputDirectoryName)
outputDirectoryName
- name of output directorypublic void setOverwrite(boolean newValue)
newValue
- if true, files are overwritten, otherwise notgetOverwrite()