public class ClasspathResourceUtil
extends java.lang.Object
| Constructor and Description |
|---|
ClasspathResourceUtil() |
| Modifier and Type | Method and Description |
|---|---|
static java.lang.String |
classpathResourceToString(java.lang.String resource,
java.nio.charset.Charset charset)
Retrieves a classpath resource using the
ClasspathResourceUtil classloader and converts it to a String using the specified
character set. |
public static java.lang.String classpathResourceToString(java.lang.String resource,
java.nio.charset.Charset charset)
throws UncheckedIOException
ClasspathResourceUtil classloader and converts it to a String using the specified
character set. If any error occurs while reading the resource, this method throws
UncheckedIOException. If the classpath resource cannot be found, this
method throws a FileNotFoundException wrapped in an UncheckedIOException.resource - classpath resource to loadcharset - charset to use to decode the classpath resourceUncheckedIOException - if the classpath resource cannot be found or cannot be read for any reason