@Override
    public MediaType streamingDetectFinal(StreamingDetectContext detectContext) {
        if (detectContext.get(SeenManifest.class) != null) {
            // Looks like a regular Jar Archive
            return MediaType.application("java-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