@Override
    public MediaType streamingDetectUpdate(ZipArchiveEntry zae, InputStream zis,
                                           StreamingDetectContext detectContext) {
        String name = zae.getName();
        if (name.equals("[Content_Types].xml")) {
            MediaType mt = parseOOXMLContentTypes(zis);
            if (mt != null) {
                return mt;
            }
            return TIKA_OOXML;
        }

        if (OOXML_HINTS.contains(name)) {
            OOXMLHintCounter cnt = detectContext.get(OOXMLHintCounter.class);
            if (cnt == null) {
                cnt = new OOXMLHintCounter();
                detectContext.set(OOXMLHintCounter.class, cnt);
            }
            cnt.increment();
            //we used to short-circuit, but ooxml files that are
            //not created by actual microsoft products do not tend to
            //put [Content_Types.xml] as the first physical entry in the zip file
            //so we need to read through the full file
            /*if (cnt.getCount() > 2) {
                return TIKA_OOXML;
            }*/
        }
        return null;
    }
Detects the type of an OfficeOpenXML (OOXML) file from
opened Package
tika-parsers/tika-parsers-standard/tika-parsers-standard-modules/tika-parser-microsoft-module/src/main/java/org/apache/tika/detect/microsoft/ooxml/OPCPackageDetector.java