public class ResourceUtil
extends java.lang.Object
| Modifier and Type | Method and Description |
|---|---|
static ResourceFile |
getResourceAsFile(java.lang.String path)
Returns the file corresponding to the given path.
|
static java.lang.String |
getResourceAsTempFile(java.lang.String resourcePath)
Creates a temporary file from the resource to load.
|
static java.net.URL |
getResourceAsURL(java.lang.String path)
Returns the file corresponding to the given path.
|
static java.lang.String |
readResourceFileToString(java.lang.String path)
Reads the contents of a resource to a string.
|
static java.util.List<java.lang.String> |
readResourceFileToStringList(ResourceFile resourceFile)
Reads the contents of a resource to a list of strings.
|
static java.util.List<java.lang.String> |
readResourceFileToStringList(java.lang.String path)
Reads the contents of a resource to a list of strings.
|
public static java.lang.String readResourceFileToString(java.lang.String path)
throws java.io.IOException
path - The path of the resource that shall be read.java.io.IOException - Throws an IOException if the file could not be read.public static java.util.List<java.lang.String> readResourceFileToStringList(java.lang.String path)
throws java.io.IOException
path - The path of the resource that shall be read.java.io.IOException - Throws an IOException if the file could not be read.public static java.util.List<java.lang.String> readResourceFileToStringList(ResourceFile resourceFile) throws java.io.IOException
resourceFile - The resource file to read.java.io.IOException - Throws an IOException if the file could not be read.public static ResourceFile getResourceAsFile(java.lang.String path)
path - The path for which a resource shall be retrieved.java.io.IOExceptionpublic static java.net.URL getResourceAsURL(java.lang.String path)
path - The path for which a resource shall be retrieved.java.io.IOExceptionpublic static java.lang.String getResourceAsTempFile(java.lang.String resourcePath)
resourcePath - The path to the resource.