public class CommonsDigester extends Object implements org.apache.tika.parser.DigestingParser.Digester
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.
If a TikaInputStream is passed in and it has an underlying file that is longer
than the markLimit, then this digester digests the file directly.
| Modifier and Type | Class and Description |
|---|---|
static class |
CommonsDigester.DigestAlgorithm |
| Constructor and Description |
|---|
CommonsDigester(int markLimit,
CommonsDigester.DigestAlgorithm... algorithms) |
| Modifier and Type | Method and Description |
|---|---|
void |
digest(InputStream is,
org.apache.tika.metadata.Metadata m,
org.apache.tika.parser.ParseContext parseContext) |
static CommonsDigester.DigestAlgorithm[] |
parse(String s) |
public CommonsDigester(int markLimit,
CommonsDigester.DigestAlgorithm... algorithms)
public void digest(InputStream is, org.apache.tika.metadata.Metadata m, org.apache.tika.parser.ParseContext parseContext) throws IOException
digest in interface org.apache.tika.parser.DigestingParser.DigesterIOExceptionpublic static CommonsDigester.DigestAlgorithm[] parse(String s)
s - comma-delimited (no space) list of algorithms to use: md5,sha256Copyright © 2007–2016 The Apache Software Foundation. All rights reserved.