Skip to content

Add support for Java archive (.jar) #719

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jan 10, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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',
];
Loading