Skip to content

Commit

Permalink
Add support for Java archive (.jar) (#719)
Browse files Browse the repository at this point in the history
  • Loading branch information
sly7-7 authored Jan 10, 2025
1 parent ef0d757 commit 8651809
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 1 deletion.
8 changes: 8 additions & 0 deletions core.js
Original file line number Diff line number Diff line change
Expand Up @@ -519,6 +519,14 @@ export class FileTypeParser {
return {
stop: true,
};
case 'META-INF/MANIFEST.MF':
fileType = {
ext: 'jar',
mime: 'application/java-archive',
};
return {
stop: true,
};
case 'mimetype':
return {
async handler(fileData) {
Expand Down
Binary file added fixture/fixture.jar
Binary file not shown.
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,8 @@
"docm",
"dotm",
"potm",
"pptm"
"pptm",
"jar"
],
"dependencies": {
"@tokenizer/inflate": "^0.2.6",
Expand Down
1 change: 1 addition & 0 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -484,6 +484,7 @@ abortController.abort(); // Abort file-type reading from the Blob stream.
- [`indd`](https://en.wikipedia.org/wiki/Adobe_InDesign#File_format) - Adobe InDesign document
- [`it`](https://wiki.openmpt.org/Manual:_Module_formats#The_Impulse_Tracker_format_.28.it.29) - Audio module format: Impulse Tracker
- [`j2c`](https://en.wikipedia.org/wiki/JPEG_2000) - JPEG 2000
- [`jar`](https://en.wikipedia.org/wiki/JAR_(file_format)) - Java archive
- [`jls`](https://en.wikipedia.org/wiki/Lossless_JPEG#JPEG-LS) - Lossless/near-lossless compression standard for continuous-tone images
- [`jp2`](https://en.wikipedia.org/wiki/JPEG_2000) - JPEG 2000
- [`jpg`](https://en.wikipedia.org/wiki/JPEG) - Joint Photographic Experts Group image
Expand Down
2 changes: 2 additions & 0 deletions supported.js
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,7 @@ export const extensions = [
'dotm',
'potm',
'pptm',
'jar',
];

export const mimeTypes = [
Expand Down Expand Up @@ -339,4 +340,5 @@ export const mimeTypes = [
'application/vnd.ms-word.template.macroEnabled.12',
'application/vnd.ms-powerpoint.template.macroEnabled.12',
'application/vnd.ms-powerpoint.presentation.macroEnabled.12',
'application/java-archive',
];

0 comments on commit 8651809

Please sign in to comment.