Skip to content

Commit 004bbe7

Browse files
committed
Add support for Java archive (.jar)
1 parent 356bce8 commit 004bbe7

File tree

5 files changed

+13
-1
lines changed

5 files changed

+13
-1
lines changed

core.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -494,6 +494,14 @@ export class FileTypeParser {
494494
return {
495495
stop: true,
496496
};
497+
case 'META-INF/MANIFEST.MF':
498+
fileType = {
499+
ext: 'jar',
500+
mime: 'application/java-archive',
501+
};
502+
return {
503+
stop: true,
504+
};
497505
case 'mimetype':
498506
return {
499507
async handler(fileData) {

fixture/fixture.jar

2.5 KB
Binary file not shown.

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,8 @@
228228
"odg",
229229
"otg",
230230
"otp",
231-
"ott"
231+
"ott",
232+
"jar"
232233
],
233234
"dependencies": {
234235
"@tokenizer/inflate": "^0.2.6",

readme.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -482,6 +482,7 @@ abortController.abort(); // Abort file-type reading from the Blob stream.
482482
- [`indd`](https://en.wikipedia.org/wiki/Adobe_InDesign#File_format) - Adobe InDesign document
483483
- [`it`](https://wiki.openmpt.org/Manual:_Module_formats#The_Impulse_Tracker_format_.28.it.29) - Audio module format: Impulse Tracker
484484
- [`j2c`](https://en.wikipedia.org/wiki/JPEG_2000) - JPEG 2000
485+
- [`jar`](https://en.wikipedia.org/wiki/JAR_(file_format)) - Java archive
485486
- [`jls`](https://en.wikipedia.org/wiki/Lossless_JPEG#JPEG-LS) - Lossless/near-lossless compression standard for continuous-tone images
486487
- [`jp2`](https://en.wikipedia.org/wiki/JPEG_2000) - JPEG 2000
487488
- [`jpg`](https://en.wikipedia.org/wiki/JPEG) - Joint Photographic Experts Group image

supported.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,7 @@ export const extensions = [
165165
'otp',
166166
'odg',
167167
'otg',
168+
'jar',
168169
];
169170

170171
export const mimeTypes = [
@@ -329,4 +330,5 @@ export const mimeTypes = [
329330
'application/vnd.oasis.opendocument.presentation-template',
330331
'application/vnd.oasis.opendocument.graphics',
331332
'application/vnd.oasis.opendocument.graphics-template',
333+
'application/java-archive',
332334
];

0 commit comments

Comments
 (0)