Package org.infinispan.protostream.impl
Class ResourceUtils
- java.lang.Object
-
- org.infinispan.protostream.impl.ResourceUtils
-
public final class ResourceUtils extends Object
- Since:
- 4.3.4
- Author:
- [email protected]
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method 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 ornull
if the resource could not be found.static String
getResourceAsString(Class<?> c, String resourcePath)
-
-
-
Method Detail
-
getContentsAsString
public static String getContentsAsString(Reader reader) throws IOException
- Throws:
IOException
-
getContentsAsString
public static String getContentsAsString(InputStream is) throws IOException
- Throws:
IOException
-
getContentsAsString
public static String getContentsAsString(File file) throws IOException
- Throws:
IOException
-
getResourceAsStream
public static InputStream getResourceAsStream(ClassLoader userClassLoader, String resourcePath)
Returns an input stream for reading the specified resource ornull
if the resource could not be found.
-
getResourceAsReader
public static Reader getResourceAsReader(Class<?> c, String resourcePath) throws UncheckedIOException
- Throws:
UncheckedIOException
-
getResourceAsString
public static String getResourceAsString(Class<?> c, String resourcePath) throws UncheckedIOException
- Throws:
UncheckedIOException
- if the resource is not found or an I/O error occurs
-
-