Package org.apache.tika.batch.fs
Class BasicTikaFSConsumer
- java.lang.Object
- 
- org.apache.tika.batch.FileResourceConsumer
- 
- org.apache.tika.batch.fs.AbstractFSConsumer
- 
- org.apache.tika.batch.fs.BasicTikaFSConsumer
 
 
 
- 
- All Implemented Interfaces:
- Callable<IFileProcessorFutureResult>
 
 public class BasicTikaFSConsumer extends AbstractFSConsumer Basic FileResourceConsumer that reads files from an input directory and writes content to the output directory.This catches all exceptions and errors and then logs them. This will re-throw errors. 
- 
- 
Field Summary- 
Fields inherited from class org.apache.tika.batch.FileResourceConsumerELAPSED_MILLIS, IO_IS, IO_OS, LOG, OOM, PARSE_ERR, PARSE_EX, TIMED_OUT
 
- 
 - 
Constructor SummaryConstructors Constructor Description BasicTikaFSConsumer(ArrayBlockingQueue<FileResource> queue, ParserFactory parserFactory, ContentHandlerFactory contentHandlerFactory, OutputStreamFactory fsOSFactory, TikaConfig tikaConfig)BasicTikaFSConsumer(ArrayBlockingQueue<FileResource> queue, Parser parser, ContentHandlerFactory contentHandlerFactory, OutputStreamFactory fsOSFactory)
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description CharsetgetOutputEncoding()booleanprocessFileResource(FileResource fileResource)Main piece of code that needs to be implemented.voidsetOutputEncoding(Charset charset)- 
Methods inherited from class org.apache.tika.batch.fs.AbstractFSConsumergetInputStream, getOutputStream
 - 
Methods inherited from class org.apache.tika.batch.FileResourceConsumercall, checkForTimedOutMillis, close, flushAndClose, getCurrentFile, getNumHandledExceptions, getNumResourcesConsumed, getXMLifiedLogMsg, getXMLifiedLogMsg, incrementHandledExceptions, isStillActive, parse, pleaseShutdown
 
- 
 
- 
- 
- 
Constructor Detail- 
BasicTikaFSConsumer@Deprecated public BasicTikaFSConsumer(ArrayBlockingQueue<FileResource> queue, ParserFactory parserFactory, ContentHandlerFactory contentHandlerFactory, OutputStreamFactory fsOSFactory, TikaConfig tikaConfig) Deprecated.- Parameters:
- queue-
- parserFactory-
- contentHandlerFactory-
- fsOSFactory-
- tikaConfig-
 
 - 
BasicTikaFSConsumerpublic BasicTikaFSConsumer(ArrayBlockingQueue<FileResource> queue, Parser parser, ContentHandlerFactory contentHandlerFactory, OutputStreamFactory fsOSFactory) 
 
- 
 - 
Method Detail- 
processFileResourcepublic boolean processFileResource(FileResource fileResource) Description copied from class:FileResourceConsumerMain piece of code that needs to be implemented. Clients are responsible for closing streams and handling the exceptions that they'd like to handle. Unchecked throwables can be thrown past this, of course. When an unchecked throwable is thrown, this logs the error, and then rethrows the exception. Clients/subclasses should make sure to catch and handle everything they can. The design goal is that the whole process should close up and shutdown soon after an unchecked exception or error is thrown. Make sure to callFileResourceConsumer.incrementHandledExceptions()appropriately in your implementation of this method.- Specified by:
- processFileResourcein class- FileResourceConsumer
- Parameters:
- fileResource- resource to process
- Returns:
- whether or not a file was successfully processed
 
 - 
getOutputEncodingpublic Charset getOutputEncoding() 
 - 
setOutputEncodingpublic void setOutputEncoding(Charset charset) 
 
- 
 
-