Package org.verapdf.processor
Class AbstractBatchProcessor
- java.lang.Object
-
- org.verapdf.processor.AbstractBatchProcessor
-
- All Implemented Interfaces:
Closeable,AutoCloseable,Component,BatchProcessor,Processor
- Direct Known Subclasses:
BatchFileProcessor
public abstract class AbstractBatchProcessor extends Object implements BatchProcessor
- Version:
- 0.1 Created 8 Nov 2016:22:58:09
- Author:
- Carl Wilson carlwilson AT github
-
-
Field Summary
Fields Modifier and Type Field Description protected ItemProcessorprocessor
-
Constructor Summary
Constructors Modifier Constructor Description protectedAbstractBatchProcessor(ItemProcessor processor)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description voidclose()ProcessorConfiggetConfig()Collection<ReleaseDetails>getDependencies()ComponentDetailsgetDetails()BatchSummaryprocess(File toProcess, boolean recurse, BatchProcessingHandler resultHandler)Process all .pdf files in a directory, optionally recursively.BatchSummaryprocess(List<? extends File> toProcess, BatchProcessingHandler resultHandler)Process a list of PDF filesprotected abstract voidprocessContainer(File container, boolean recurse)protected abstract voidprocessList(List<? extends File> toProcess)protected voidprocessResult(ProcessorResult result, Boolean isLogsEnabled)
-
-
-
Field Detail
-
processor
protected final ItemProcessor processor
-
-
Constructor Detail
-
AbstractBatchProcessor
protected AbstractBatchProcessor(ItemProcessor processor)
- See Also:
org.verapdf.processor.BatchProcessor#process(java.io.File, boolean, org.verapdf.processor.ProcessorResultHandler)
-
-
Method Detail
-
getConfig
public ProcessorConfig getConfig()
- Specified by:
getConfigin interfaceProcessor- Returns:
- the
ProcessorConfigthat holds the details for the configuration of thisProcessor - See Also:
Processor.getConfig()
-
getDependencies
public Collection<ReleaseDetails> getDependencies()
- Specified by:
getDependenciesin interfaceProcessor- Returns:
- a
CollectionofReleaseDetailsfor theProcessor's dependencies, for auditing. - See Also:
Processor.getDependencies()
-
getDetails
public ComponentDetails getDetails()
- Specified by:
getDetailsin interfaceComponent- See Also:
Component.getDetails()
-
close
public void close() throws IOException- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Throws:
IOException- See Also:
Closeable.close()
-
process
public BatchSummary process(File toProcess, boolean recurse, BatchProcessingHandler resultHandler) throws VeraPDFException
Description copied from interface:BatchProcessorProcess all .pdf files in a directory, optionally recursively.- Specified by:
processin interfaceBatchProcessor- Parameters:
toProcess- aFilethat denotes a directory to processrecurse- settrueto recurse into sub-directories, false if recursion not required.resultHandler- theBatchProcessingHandlerthat will be used to process the results- Returns:
- a
BatchSummarythat reports the details of the batch process - Throws:
VeraPDFException- when an error occurs during processing.
-
process
public BatchSummary process(List<? extends File> toProcess, BatchProcessingHandler resultHandler) throws VeraPDFException
Description copied from interface:BatchProcessorProcess a list of PDF files- Specified by:
processin interfaceBatchProcessor- Parameters:
toProcess- aListofFiles to processresultHandler- theBatchProcessingHandlerthat will be used to process the results- Returns:
- a
BatchSummarythat reports the details of the batch process - Throws:
VeraPDFException- when an error occurs during processing.
-
processContainer
protected abstract void processContainer(File container, boolean recurse) throws VeraPDFException
- Throws:
VeraPDFException
-
processList
protected abstract void processList(List<? extends File> toProcess) throws VeraPDFException
- Throws:
VeraPDFException
-
processResult
protected void processResult(ProcessorResult result, Boolean isLogsEnabled) throws VeraPDFException
- Throws:
VeraPDFException
-
-