public class ResourcesUtils extends Object
Constructor and Description |
---|
ResourcesUtils() |
Modifier and Type | Method and Description |
---|---|
static File |
getResourceAsFile(ClassLoader loader,
String resource)
Returns a resource on the classpath as a File object
|
static File |
getResourceAsFile(String resource)
Returns a resource on the classpath as a File object
|
static Properties |
getResourceAsProperties(ClassLoader loader,
String resource)
Returns a resource on the classpath as a Properties object
|
static Properties |
getResourceAsProperties(String resource)
Returns a resource on the classpath as a Properties object
|
static Reader |
getResourceAsReader(ClassLoader loader,
String resource)
Returns a resource on the classpath as a Reader object
|
static InputStreamReader |
getResourceAsReader(String resource)
Returns a resource on the classpath as a Reader object
|
static InputStream |
getResourceAsStream(ClassLoader loader,
String resource)
Returns a resource on the classpath as a Stream object
|
static InputStream |
getResourceAsStream(String resource)
Returns a resource on the classpath as a Stream object
|
static URL |
getResourceURL(ClassLoader loader,
String resource)
Returns the URL of the resource on the classpath
|
static URL |
getResourceURL(String resource)
Returns the URL of the resource on the classpath
|
public static URL getResourceURL(String resource) throws IOException
resource
- The resource to findIOException
- If the resource cannot be found or readpublic static URL getResourceURL(ClassLoader loader, String resource) throws IOException
loader
- The classloader used to load the resourceresource
- The resource to findIOException
- If the resource cannot be found or readpublic static InputStream getResourceAsStream(String resource) throws IOException
resource
- The resource to findIOException
- If the resource cannot be found or readpublic static InputStream getResourceAsStream(ClassLoader loader, String resource) throws IOException
loader
- The classloader used to load the resourceresource
- The resource to findIOException
- If the resource cannot be found or readpublic static Properties getResourceAsProperties(String resource) throws IOException
resource
- The resource to findIOException
- If the resource cannot be found or readpublic static Properties getResourceAsProperties(ClassLoader loader, String resource) throws IOException
loader
- The classloader used to load the resourceresource
- The resource to findIOException
- If the resource cannot be found or readpublic static InputStreamReader getResourceAsReader(String resource) throws IOException
resource
- The resource to findIOException
- If the resource cannot be found or readpublic static Reader getResourceAsReader(ClassLoader loader, String resource) throws IOException
loader
- The classloader used to load the resourceresource
- The resource to findIOException
- If the resource cannot be found or readpublic static File getResourceAsFile(String resource) throws IOException
resource
- The resource to findIOException
- If the resource cannot be found or readpublic static File getResourceAsFile(ClassLoader loader, String resource) throws IOException
loader
- The classloader used to load the resourceresource
- The resource to findIOException
- If the resource cannot be found or readCopyright © 2021. All rights reserved.