Package org.apache.tika.parser.utils
Class CommonsDigester
- java.lang.Object
-
- org.apache.tika.parser.digest.CompositeDigester
-
- org.apache.tika.parser.utils.CommonsDigester
-
- All Implemented Interfaces:
DigestingParser.Digester
public class CommonsDigester extends CompositeDigester
Implementation ofDigestingParser.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
Nested Classes Modifier and Type Class Description static class
CommonsDigester.DigestAlgorithm
-
Constructor Summary
Constructors Constructor Description CommonsDigester(int markLimit, java.lang.String algorithmString)
Include a string representing the comma-separated algorithms to run: e.g.CommonsDigester(int markLimit, CommonsDigester.DigestAlgorithm... algorithms)
Deprecated.
-
Method Summary
All Methods Static Methods Concrete Methods Deprecated Methods Modifier and Type Method Description static CommonsDigester.DigestAlgorithm[]
parse(java.lang.String s)
Deprecated.use theCommonsDigester(int, String)
instead-
Methods inherited from class org.apache.tika.parser.digest.CompositeDigester
digest
-
-
-
-
Constructor Detail
-
CommonsDigester
public CommonsDigester(int markLimit, java.lang.String algorithmString)
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
public CommonsDigester(int markLimit, CommonsDigester.DigestAlgorithm... algorithms)
Deprecated.- Parameters:
markLimit
- limit for mark/reset; after this limit is hit, the stream is reset and spooled to diskalgorithms
- algorithms to run
-
-
Method Detail
-
parse
@Deprecated public static CommonsDigester.DigestAlgorithm[] parse(java.lang.String s)
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:
-
-