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:
- anistor@redhat.com
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static StringgetContentsAsString(File file)static StringgetContentsAsString(InputStream is)static StringgetContentsAsString(Reader reader)static ReadergetResourceAsReader(Class<?> c, String resourcePath)static InputStreamgetResourceAsStream(ClassLoader userClassLoader, String resourcePath)Returns an input stream for reading the specified resource ornullif the resource could not be found.static StringgetResourceAsString(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 ornullif 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
-
-