Returns a URL to a resource in a module defined to this class loader. Class loader implementations that support the loading from modules should override this method.
moduleName
| The module name; or null to find a resource in the
unnamed module for this
class loader | |
name
| The resource name |
null
if the resource could not be
found, a URL could not be constructed to locate the resource,
access to the resource is denied by the security manager, or
there isn't a module of the given name defined to the class
loader.
IOException
| If I/O errors occur |
java.lang.module.ModuleReader.find(String)
@apiNote This method is the basis for the Class.getResource
, Class.getResourceAsStream
, and Module.getResourceAsStream
methods. It is not subject to the rules for
encapsulation specified by Module.getResourceAsStream
.
@implSpec The default implementation attempts to find the resource by
invoking findResource(String)
when the moduleName
is
null
. It otherwise returns null
.
@spec JPMS
Diagram: ClassLoader