public class ResourcesUtil
extends java.lang.Object
Constructor and Description |
---|
ResourcesUtil() |
Modifier and Type | Method and Description |
---|---|
static java.io.InputStream |
getResourceAsStream(java.lang.String resourceName)
Opens a resource of the specified name for reading.
|
static java.io.InputStream |
getResourceAsStream(java.lang.String resourceName,
java.lang.ClassLoader callingClass)
Opens a resource of the specified name for reading.
|
static java.io.InputStream |
getResourceAsStream(java.lang.String resourceName,
java.lang.ClassLoader callingClass,
boolean useCache)
Opens a resource of the specified name for reading.
|
static java.lang.String |
getResourceAsString(java.lang.String resourceName) |
static java.net.URL |
getResourceUrl(java.lang.String resourceName)
Retrieves given resource as URL.
|
static java.net.URL |
getResourceUrl(java.lang.String resourceName,
java.lang.ClassLoader classLoader)
Retrieves given resource as URL.
|
public static java.net.URL getResourceUrl(java.lang.String resourceName)
getResourceUrl(String, ClassLoader)
public static java.net.URL getResourceUrl(java.lang.String resourceName, java.lang.ClassLoader classLoader)
Resource will be loaded using class loaders in the following order:
Thread.currentThread().getContextClassLoader()
ClassLoaderUtil.class.getClassLoader()
callingClass
is provided: callingClass.getClassLoader()
public static java.lang.String getResourceAsString(java.lang.String resourceName) throws java.io.IOException
java.io.IOException
public static java.io.InputStream getResourceAsStream(java.lang.String resourceName) throws java.io.IOException
java.io.IOException
getResourceAsStream(String, ClassLoader)
public static java.io.InputStream getResourceAsStream(java.lang.String resourceName, java.lang.ClassLoader callingClass) throws java.io.IOException
java.io.IOException
getResourceUrl(String, ClassLoader)
public static java.io.InputStream getResourceAsStream(java.lang.String resourceName, java.lang.ClassLoader callingClass, boolean useCache) throws java.io.IOException
java.io.IOException
Copyright © 2003-present Jodd Team