@@ -51,7 +51,7 @@ public MediaType detect(ZipFile zip, TikaInputStream tis) throws IOException {
51
51
return MediaType .application ("x-tika-java-enterprise-archive" );
52
52
}
53
53
// AAB archive
54
- if (zip .getEntry ("base/manifest/AndroidManifest.xml" ) != null ) {
54
+ if (zip .getEntry ("base/manifest/AndroidManifest.xml" ) != null ) {
55
55
return MediaType .application ("x-authorware-bin" );
56
56
}
57
57
@@ -72,29 +72,23 @@ public MediaType streamingDetectUpdate(ZipArchiveEntry zae, InputStream zis,
72
72
StreamingDetectContext detectContext ) {
73
73
74
74
String name = zae .getName ();
75
+
75
76
if (name .equals ("AndroidManifest.xml" )) {
76
77
return MediaType .application ("vnd.android.package-archive" );
78
+ } else if (name .equals ("base/manifest/AndroidManifest.xml" )) {
79
+ return MediaType .application ("x-authorware-bin" );
77
80
} else if (name .equals ("META-INF/MANIFEST.MF" )) {
78
81
// It's a Jar file, or something based on Jar
79
82
detectContext .set (SeenManifest .class , SEEN_MANIFEST );
80
- } else if (name .equals ("base/manifest/AndroidManifest.xml" ) != null ) {
81
- return MediaType .application ("x-authorware-bin" );
82
- }
83
+ }
83
84
84
85
SeenManifest seenManifest = detectContext .get (SeenManifest .class );
85
86
86
87
if (seenManifest != null ) {
87
- if (name .equals ("AndroidManifest.xml" )) {
88
- // Is it an Android APK?
89
- return MediaType .application ("vnd.android.package-archive" );
90
- } else if (name .equals ("WEB-INF/" )) {
88
+ if (name .equals ("WEB-INF/" )) {
91
89
// Check for WAR and EAR
92
90
return MediaType .application ("x-tika-java-web-archive" );
93
- } else if (name .equals ("base/manifest/AndroidManifest.xml" ) != null ) {
94
- // Check for AAB bundle
95
- return MediaType .application ("x-authorware-bin" );
96
91
}
97
-
98
92
if (name .equals ("META-INF/application.xml" )) {
99
93
return MediaType .application ("x-tika-java-enterprise-archive" );
100
94
}
0 commit comments