Class BinaryContentTransformer
java.lang.Object
com.norconex.importer.handler.transformer.impl.BinaryContentTransformer
- All Implemented Interfaces:
Configurable<BinaryContentTransformerConfig>,ConfigurableDocHandler<BinaryContentTransformerConfig>,DocHandler
public class BinaryContentTransformer
extends Object
implements ConfigurableDocHandler<BinaryContentTransformerConfig>
Captures the document's original, unparsed content and stores it, Base64-encoded, in a metadata field. This is meant for consumers that need access to the raw document bytes after parsing has taken place (parsing normally discards the original content), such as a committer uploading the original file content rather than the extracted text.
Must be used as a pre-parse handler: the document is still in its original format at that point. Using it post-parse raises an error since the original content is no longer available by then.
- See Also:
-
Field Summary
Fields inherited from interface com.norconex.commons.lang.config.Configurable
PROPERTYFields inherited from interface com.norconex.importer.handler.DocHandler
NAME -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected booleanbooleanbooleanhandle(DocHandlerContext docCtx) Perform any operations on a document.inthashCode()toString()Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface com.norconex.importer.handler.DocHandler
close, init
-
Constructor Details
-
BinaryContentTransformer
public BinaryContentTransformer()
-
-
Method Details
-
handle
Description copied from interface:DocHandlerPerform any operations on a document.- Specified by:
handlein interfaceDocHandler- Parameters:
docCtx- the document handling context- Returns:
falseto stop processing and reject a document ortrueto proceed to the next configured handler.- Throws:
IOException- An I/O exception of some sort has occurred
-
getConfiguration
- Specified by:
getConfigurationin interfaceConfigurable<BinaryContentTransformerConfig>
-
equals
-
canEqual
-
hashCode
public int hashCode() -
toString
-