public class CommonsDigester extends CompositeDigester
DigestingParser.Digester
that relies on commons.codec.digest.DigestUtils to calculate digest hashes.
This digester tries to use the regular mark/reset protocol on the InputStream. However, this wraps an internal BoundedInputStream, and if the InputStream is not fully read, then this will reset the stream and spool the InputStream to disk (via TikaInputStream) and then digest the file.
| Modifier and Type | Class and Description |
|---|---|
private static class |
CommonsDigester.Base32Encoder |
static class |
CommonsDigester.DigestAlgorithm |
private static class |
CommonsDigester.HexEncoder |
| Constructor and Description |
|---|
CommonsDigester(int markLimit,
CommonsDigester.DigestAlgorithm... algorithms)
Deprecated.
|
CommonsDigester(int markLimit,
java.lang.String algorithmString)
Include a string representing the comma-separated algorithms to run: e.g.
|
| Modifier and Type | Method and Description |
|---|---|
private static DigestingParser.Digester[] |
buildDigesters(int markLimit,
CommonsDigester.DigestAlgorithm[] algorithms) |
private static DigestingParser.Digester[] |
buildDigesters(int markLimit,
java.lang.String digesterDef) |
private static CommonsDigester.DigestAlgorithm |
getDigestAlgorithm(java.lang.String algoString) |
static CommonsDigester.DigestAlgorithm[] |
parse(java.lang.String s)
Deprecated.
use the
CommonsDigester(int, String) instead |
digestpublic CommonsDigester(int markLimit,
java.lang.String algorithmString)
markLimit - algorithmString - public CommonsDigester(int markLimit,
CommonsDigester.DigestAlgorithm... algorithms)
CommonsDigester(int, String)markLimit - limit for mark/reset; after this limit is hit, the
stream is reset and spooled to diskalgorithms - algorithms to runprivate static DigestingParser.Digester[] buildDigesters(int markLimit, CommonsDigester.DigestAlgorithm[] algorithms)
@Deprecated public static CommonsDigester.DigestAlgorithm[] parse(java.lang.String s)
CommonsDigester(int, String) insteadCommonsDigester(int, String).s - comma-delimited (no space) list of algorithms to use: md5,sha256.private static CommonsDigester.DigestAlgorithm getDigestAlgorithm(java.lang.String algoString)
private static DigestingParser.Digester[] buildDigesters(int markLimit, java.lang.String digesterDef)