Class ZipContainerDetector

  • All Implemented Interfaces:
    Serializable, org.apache.tika.detect.Detector

    public class ZipContainerDetector
    extends Object
    implements org.apache.tika.detect.Detector
    A detector that works on Zip documents and other archive and compression formats to figure out exactly what the file is.
    See Also:
    Serialized Form
    • Constructor Detail

      • ZipContainerDetector

        public ZipContainerDetector()
    • Method Detail

      • detect

        public org.apache.tika.mime.MediaType detect​(InputStream input,
                                                     org.apache.tika.metadata.Metadata metadata)
                                              throws IOException
        Specified by:
        detect in interface org.apache.tika.detect.Detector
        Throws:
        IOException
      • setMarkLimit

        public void setMarkLimit​(int markLimit)
        If this is less than 0, the file will be spooled to disk, and detection will run on the full file. If this is greater than 0, the StreamingZipContainerDetector will be called only up to the markLimit.
        Parameters:
        markLimit - mark limit for streaming detection
      • detectOfficeOpenXML

        public static org.apache.tika.mime.MediaType detectOfficeOpenXML​(org.apache.poi.openxml4j.opc.OPCPackage pkg)
        Detects the type of an OfficeOpenXML (OOXML) file from opened Package