@Override
    public MediaType streamingDetectUpdate(ZipArchiveEntry zae, InputStream zis,
                                           StreamingDetectContext detectContext) {

        String name = zae.getName();

        if (name.equals("AndroidManifest.xml")) {
            return MediaType.application("vnd.android.package-archive");
        } else if (name.equals("base/manifest/AndroidManifest.xml")) {
            return MediaType.application("x-authorware-bin");
        } else if (name.equals("META-INF/MANIFEST.MF")) {
            // It's a Jar file, or something based on Jar
            detectContext.set(SeenManifest.class, SEEN_MANIFEST);
        }
        
        SeenManifest seenManifest = detectContext.get(SeenManifest.class);

        if (seenManifest != null) {
            if (name.equals("WEB-INF/")) {
                // Check for WAR and EAR
                return MediaType.application("x-tika-java-web-archive");
            }
            if (name.equals("META-INF/application.xml")) {
                return MediaType.application("x-tika-java-enterprise-archive");
            }
        }
        return null;

    }
This detector detects JAR files and file type variants of zip subtypes
that may contain a MANIFEST.MF
tika-parsers/tika-parsers-standard/tika-parsers-standard-modules/tika-parser-zip-commons/src/main/java/org/apache/tika/detect/zip/JarDetector.java