public class LoadableFileBatchJob extends FileBatchJob
FileBatchJob.ExceptionOccurrence
batchJobTimeout, exceptions, filesFailed, noOfFilesProcessed
Constructor and Description |
---|
LoadableFileBatchJob(File classFile,
List<String> arguments)
Create a new batch job that runs the loaded class.
|
Modifier and Type | Method and Description |
---|---|
void |
finish(OutputStream os)
Finish up the job.
|
void |
initialize(OutputStream os)
Initialize the job before runnning.
|
protected void |
loadBatchJob()
Method for initializing the loaded batchjob.
|
boolean |
postProcess(InputStream input,
OutputStream output)
Processes the concatenated result files.
|
boolean |
processFile(File file,
OutputStream os)
Process one file stored in the bit archive.
|
String |
toString()
Override of the default toString to include name of loaded class.
|
addException, addFinishException, addInitializeException, getBatchJobTimeout, getExceptions, getFilenamePattern, getFilesFailed, getNoOfFilesProcessed, maxExceptionsReached, processOnlyFileNamed, processOnlyFilesMatching, processOnlyFilesMatching, processOnlyFilesNamed, setBatchJobTimeout
public LoadableFileBatchJob(File classFile, List<String> arguments) throws ArgumentNotValid
classFile
- the classfile for the batch job we want to run.arguments
- The arguments for the batchjobs. This can be null.ArgumentNotValid
- If the classfile is null.public void initialize(OutputStream os)
initialize
in class FileBatchJob
os
- the OutputStream to which output should be writtenprotected void loadBatchJob() throws IOFailure
IOFailure
- If the batchjob cannot be loaded.public boolean processFile(File file, OutputStream os)
processFile
in class FileBatchJob
file
- the file to be processed.os
- the OutputStream to which output should be writtenpublic void finish(OutputStream os)
finish
in class FileBatchJob
os
- the OutputStream to which output should be writtenpublic boolean postProcess(InputStream input, OutputStream output)
FileBatchJob
postProcess
in class FileBatchJob
input
- The inputstream to the file containing the concatenated results.output
- The outputstream where the resulting data should be written.Copyright © 2005–2016 The Royal Danish Library, the Danish State and University Library, the National Library of France and the Austrian National Library.. All rights reserved.