public class Resources extends Object
| Constructor and Description |
|---|
Resources() |
| Modifier and Type | Method and Description |
|---|---|
static URL |
get(String name)
Finds a resource with a given name.
|
static String |
getAbsolutePath(String name)
Find a resource with a given
name and return an absolute file
path to access that resource using File path based APIs. |
public static URL get(String name)
ClassLoader.getSystemResourceAsStream(java.lang.String).
Before delegation, an absolute resource name is constructed from the given resource name using this algorithm:
name begins with a '/' ('\u002f'
), then the absolute name of the resource is the portion of the
name following the '/'.
modified_package_name/name
Where the modified_package_name is the package name of this
object with '/' substituted for '.' (
'\u002e').
name - name of the desired resourceInputStream object or null if
no resource with this name is foundNullPointerException - If name is null