public final class ResourceUtil extends Object
Modifier and Type | Method and Description |
---|---|
static String |
getResourceId(String library,
String name) |
static String |
getResourceId(javax.faces.component.UIComponent componentResource) |
static InputStream |
toInputStream(String string,
String encoding)
Converts a String to an
InputStream . |
static String |
toString(InputStream inputStream,
String encoding,
int bufferSize)
Converts an
InputStream to a String. |
public static String getResourceId(javax.faces.component.UIComponent componentResource)
public static InputStream toInputStream(String string, String encoding) throws UnsupportedEncodingException
InputStream
.string
- The string that is to be encoded and converted into an InputStream
.encoding
- The character set that is to be used for encoding the string prior to conversion.InputStream
representation of the specified string, after having first been encoded
according to the specified character set.UnsupportedEncodingException
- If the specified encoding character set is not supported.public static String toString(InputStream inputStream, String encoding, int bufferSize) throws IOException
InputStream
to a String.inputStream
- The InputStream which contains some text.encoding
- The encoding of the text of the InputStream.bufferSize
- The size of the character buffer to be used when reading the file. If you do not want to
specify this value, use toInputStream(java.lang.String,
java.lang.String)
which provides a default of 1024.IOException
- If an error occurs while reading the specified input stream.Copyright © 2018 Liferay, Inc.. All rights reserved.