How to load resources from base module

Alan Bateman Alan.Bateman at
Mon May 22 08:30:27 UTC 2017

On 22/05/2017 09:05, wzberger wrote:

> ClassA acts as a kind of resource loader and only the resource string 
> is passed - is it possible to include the module name in the resource 
> string something like "module!resource"?
The module name isn't unique either. Can you say a bit more about 
ClassA? It is really just a wrapper around Class.getResource or does it 
do something with the resource. Could the classA API take Supplier<URL> 
or Supplier<InputStream> so that the resource lookup is actually 
executed in the context of classA's caller?  Alternatively, if the code 
ClassA insists on calling Class.getResource then would it be a burden to 
have the callers pass in some context - in the example then code in 
com.b could call this API with a type token or the Module object for com.b.


More information about the jigsaw-dev mailing list