Class CommonsDigesterFactory
java.lang.Object
org.apache.tika.parser.digestutils.CommonsDigesterFactory
- All Implemented Interfaces:
DigesterFactory
Factory for
CommonsDigester with configurable algorithms and encodings.
Default: MD5 with HEX encoding.
Example JSON configuration (in parse-context section):
{
"parse-context": {
"digester-factory": {
"commons-digester-factory": {
"digests": [
{ "algorithm": "MD5" },
{ "algorithm": "SHA256", "encoding": "BASE32" }
],
"skipContainerDocumentDigest": false
}
}
}
}
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbuild()Build a new Digester instance using the factory's configured properties.booleanReturns whether to skip digesting for container (top-level) documents.voidsetDigests(List<DigestDef> digests) voidsetSkipContainerDocumentDigest(boolean skipContainerDocumentDigest)
-
Constructor Details
-
CommonsDigesterFactory
public CommonsDigesterFactory()
-
-
Method Details
-
build
Description copied from interface:DigesterFactoryBuild a new Digester instance using the factory's configured properties.- Specified by:
buildin interfaceDigesterFactory- Returns:
- a new Digester instance
-
isSkipContainerDocumentDigest
public boolean isSkipContainerDocumentDigest()Description copied from interface:DigesterFactoryReturns whether to skip digesting for container (top-level) documents. When true, only embedded documents (depth > 0) will be digested.Default implementation returns false (digest everything).
- Specified by:
isSkipContainerDocumentDigestin interfaceDigesterFactory- Returns:
- true if container documents should be skipped, false otherwise
-
setSkipContainerDocumentDigest
public void setSkipContainerDocumentDigest(boolean skipContainerDocumentDigest) -
getDigests
-
setDigests
-