Skip to content

Commit 8651809

Browse files
authored
Add support for Java archive (.jar) (#719)
1 parent ef0d757 commit 8651809

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
@@ -519,6 +519,14 @@ export class FileTypeParser {
519519
return {
520520
stop: true,
521521
};
522+
case 'META-INF/MANIFEST.MF':
523+
fileType = {
524+
ext: 'jar',
525+
mime: 'application/java-archive',
526+
};
527+
return {
528+
stop: true,
529+
};
522530
case 'mimetype':
523531
return {
524532
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
@@ -233,7 +233,8 @@
233233
"docm",
234234
"dotm",
235235
"potm",
236-
"pptm"
236+
"pptm",
237+
"jar"
237238
],
238239
"dependencies": {
239240
"@tokenizer/inflate": "^0.2.6",

readme.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -484,6 +484,7 @@ abortController.abort(); // Abort file-type reading from the Blob stream.
484484
- [`indd`](https://en.wikipedia.org/wiki/Adobe_InDesign#File_format) - Adobe InDesign document
485485
- [`it`](https://wiki.openmpt.org/Manual:_Module_formats#The_Impulse_Tracker_format_.28.it.29) - Audio module format: Impulse Tracker
486486
- [`j2c`](https://en.wikipedia.org/wiki/JPEG_2000) - JPEG 2000
487+
- [`jar`](https://en.wikipedia.org/wiki/JAR_(file_format)) - Java archive
487488
- [`jls`](https://en.wikipedia.org/wiki/Lossless_JPEG#JPEG-LS) - Lossless/near-lossless compression standard for continuous-tone images
488489
- [`jp2`](https://en.wikipedia.org/wiki/JPEG_2000) - JPEG 2000
489490
- [`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
@@ -170,6 +170,7 @@ export const extensions = [
170170
'dotm',
171171
'potm',
172172
'pptm',
173+
'jar',
173174
];
174175

175176
export const mimeTypes = [
@@ -339,4 +340,5 @@ export const mimeTypes = [
339340
'application/vnd.ms-word.template.macroEnabled.12',
340341
'application/vnd.ms-powerpoint.template.macroEnabled.12',
341342
'application/vnd.ms-powerpoint.presentation.macroEnabled.12',
343+
'application/java-archive',
342344
];

0 commit comments

Comments
 (0)