public interface ResourceLoader
Modifier and Type | Method and Description |
---|---|
java.nio.file.Path |
getLocalResource(java.lang.String pathName)
Gets the
Path reference to this local resource. |
default java.net.URL |
getResource(java.lang.Class<?> clazz,
java.lang.String pathName)
Gets the bundled resource URL by name, relative to the provided class.
|
default java.net.URL |
getRootResource(java.lang.String pathName)
Gets the bundled resource URL by name.
|
@Nullable default java.net.URL getResource(java.lang.Class<?> clazz, java.lang.String pathName) throws java.io.IOException
The path name must not start with /
.
clazz
- The class to search relative topathName
- The path namejava.io.IOException
- if an IO issue occurs@Nullable default java.net.URL getRootResource(java.lang.String pathName) throws java.io.IOException
The path name must not start with /
. It is always
absolute.
pathName
- The path namejava.io.IOException
- if an IO issue occursjava.nio.file.Path getLocalResource(java.lang.String pathName)
Path
reference to this local resource. The file may not
exist.pathName
- The path name