public class ClasspathResourceUtil extends Object
| Constructor and Description |
|---|
ClasspathResourceUtil() |
| Modifier and Type | Method and Description |
|---|---|
static String |
classpathResourceToString(String resource,
Charset charset)
Retrieves a classpath resource using the
ClasspathResourceUtil classloader and converts it to a String using the specified
character set. |
public static String classpathResourceToString(String resource, 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 reasonCopyright © 2017. All rights reserved.