Class CommonsDigester
java.lang.Object
org.apache.tika.parser.digest.CompositeDigester
org.apache.tika.parser.digestutils.CommonsDigester
- All Implemented Interfaces:
DigestingParser.Digester
Implementation of
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.
-
Nested Class Summary
-
Constructor Summary
ConstructorDescriptionCommonsDigester
(int markLimit, String algorithmString) Include a string representing the comma-separated algorithms to run: e.g.CommonsDigester
(int markLimit, CommonsDigester.DigestAlgorithm... algorithms) -
Method Summary
Methods inherited from class org.apache.tika.parser.digest.CompositeDigester
digest
-
Constructor Details
-
CommonsDigester
Include a string representing the comma-separated algorithms to run: e.g. "md5,sha1". If you want base 32 encoding instead of hexadecimal, add ":32" to the algorithm, e.g. "md5,sha1:32" Will throw an IllegalArgumentException if an algorithm isn't supported- Parameters:
markLimit
-algorithmString
-
-
CommonsDigester
- Parameters:
markLimit
- limit for mark/reset; after this limit is hit, the stream is reset and spooled to diskalgorithms
- algorithms to run
-
-
Method Details
-
parse
Deprecated.use theCommonsDigester(int, String)
insteadThis returns digest algorithms only. It does not understand the encoding syntax, e.g. "MD5:32" (base 32 encoding of MD5). To parse those, seeCommonsDigester(int, String)
.- Parameters:
s
- comma-delimited (no space) list of algorithms to use: md5,sha256.- Returns:
-
CommonsDigester(int, String)
instead