Class StreamingZipContainerDetector

java.lang.Object
org.apache.tika.detect.zip.DefaultZipContainerDetector
org.apache.tika.detect.zip.StreamingZipContainerDetector
All Implemented Interfaces:
Serializable, org.apache.tika.config.SelfConfiguring, org.apache.tika.detect.Detector

public class StreamingZipContainerDetector extends DefaultZipContainerDetector
A zip container detector that uses only streaming detection, never opening the file as a ZipFile. This is primarily used in tests to verify streaming detection behavior.

Unlike DefaultZipContainerDetector, this will never try to open the File as a ZipFile; this relies solely on streaming detection.

If you need to limit the amount of data read during detection, wrap your input stream in a BoundedInputStream before passing it to the detector.

See Also:
  • Constructor Details

    • StreamingZipContainerDetector

      public StreamingZipContainerDetector()
    • StreamingZipContainerDetector

      public StreamingZipContainerDetector(org.apache.tika.config.ServiceLoader loader)
    • StreamingZipContainerDetector

      public StreamingZipContainerDetector(List<ZipContainerDetector> zipDetectors)
  • Method Details

    • detect

      public org.apache.tika.mime.MediaType detect(org.apache.tika.io.TikaInputStream tis, org.apache.tika.metadata.Metadata metadata, org.apache.tika.parser.ParseContext parseContext) throws IOException
      Specified by:
      detect in interface org.apache.tika.detect.Detector
      Overrides:
      detect in class DefaultZipContainerDetector
      Throws:
      IOException