public final class ResourceUtils extends Object
| Modifier and Type | Method and Description |
|---|---|
static String |
getContentsAsString(File file) |
static String |
getContentsAsString(InputStream is) |
static String |
getContentsAsString(Reader reader) |
static Reader |
getResourceAsReader(Class<?> c,
String resourcePath) |
static InputStream |
getResourceAsStream(ClassLoader userClassLoader,
String resourcePath)
Returns an input stream for reading the specified resource or
null if the resource could not be found. |
static String |
getResourceAsString(Class<?> c,
String resourcePath)
|
public static String getContentsAsString(Reader reader) throws IOException
IOExceptionpublic static String getContentsAsString(InputStream is) throws IOException
IOExceptionpublic static String getContentsAsString(File file) throws IOException
IOExceptionpublic static InputStream getResourceAsStream(ClassLoader userClassLoader, String resourcePath)
null if the resource could not be found.public static Reader getResourceAsReader(Class<?> c, String resourcePath) throws UncheckedIOException
UncheckedIOExceptionpublic static String getResourceAsString(Class<?> c, String resourcePath) throws UncheckedIOException
UncheckedIOException - if the resource is not found or an I/O error occursCopyright © 2021 JBoss, a division of Red Hat. All rights reserved.