Skip to content

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

Open
@francescopioscognamiglio

Description

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).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions