Class CompositeDigester

java.lang.Object
org.apache.tika.digest.CompositeDigester
All Implemented Interfaces:
Digester
Direct Known Subclasses:
BouncyCastleDigester, CommonsDigester

public class CompositeDigester extends Object implements Digester
  • Constructor Details

    • CompositeDigester

      public CompositeDigester(Digester... digesters)
  • Method Details

    • digest

      public void digest(TikaInputStream tis, Metadata m, ParseContext parseContext) throws IOException
      Description copied from interface: Digester
      Digests a TikaInputStream and sets the appropriate value(s) in the metadata. The Digester is responsible for calling TikaInputStream.enableRewind() and TikaInputStream.rewind() to ensure the stream can be read by subsequent processing after digesting.

      The stream must not be closed by the digester.

      Specified by:
      digest in interface Digester
      Parameters:
      tis - TikaInputStream to digest
      m - Metadata to set the values for
      parseContext - ParseContext
      Throws:
      IOException - on I/O error
    • digestSink

      public DigestSink digestSink(Metadata m, ParseContext parseContext) throws IOException
      Fans each write out to every child's sink; commit and close reach them all.
      Specified by:
      digestSink in interface Digester
      Parameters:
      m - Metadata the values are set on when the sink is committed
      parseContext - ParseContext
      Returns:
      a sink; the caller must close it, and the values are set only if it was committed
      Throws:
      IOException