|
JIU 0.14.3 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.sourceforge.jiu.ops.Operation
net.sourceforge.jiu.ops.BatchProcessorOperation
public abstract class BatchProcessorOperation
Abstract base class to do batch processing on files and complete directory trees.
For a non-abstract extension of this operation, you must implement processFile(java.lang.String, java.lang.String, java.lang.String)
.
Constructor Summary | |
---|---|
BatchProcessorOperation()
|
Method Summary | |
---|---|
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. |
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. |
Methods inherited from class net.sourceforge.jiu.ops.Operation |
---|
addProgressListener, addProgressListeners, getAbort, removeProgressListener, setAbort, setProgress, setProgress |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public BatchProcessorOperation()
Method Detail |
---|
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.
process
in class Operation
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()
|
JIU 0.14.3 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |