resource-loader icon indicating copy to clipboard operation
resource-loader copied to clipboard

Load file resource when used in a modular runtime image application.

Open renaudberube opened this issue 3 years ago • 0 comments

This PR adds the ability for the library to load file resource (not directory though) when it is run in a modular runtime image application that was created with JLink, using this plugin.

Because this library is not modular, it is merged into a single jar and ends up in the application main module. The relative path to resources stay the same but since they are now packaged within the "modules" file in the image, you have to use ClassLoader.getResourceAsStream.

The changes in this PR should not change the way this library behaves. All existing tests are passing.

You can find an example of a modular runtime image app using it at example

renaudberube avatar Feb 17 '22 19:02 renaudberube