Skip to content
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

The mime.types file is a root-level resource and may cause unexpected behaviors in the class loader #270

Open
francescopioscognamiglio opened this issue May 14, 2024 · 0 comments

Comments

@francescopioscognamiglio

Problem
The mime.types file is placed at the root level of the resources.
So, to load it we will use the class loader passing the file name (without any package) - as you can see here https://github.com/dbmdz/iif-apis/blob/main/src/main/java/de/digitalcollections/iif/model/MimeType.java#L45.
This means that, depending on the class loader implementation, if you have multiple jars containing the same mime.type file at the root level, you may load the wrong file from another library.

Resolution
A simple solution could be to move the mime.types to a specific package.
Then, to load the resource, we can specify the package (for example de/digitalcollections/iiif/utils/mime.types).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant