public class EncodedResource extends Object
Resource
with a specific encoding to be used for reading from the resource.
Used as argument for operations that support to read content with
a specific encoding (usually through a java.io.Reader.
Reader| Constructor and Description |
|---|
EncodedResource(Resource resource)
Create a new EncodedResource for the given Resource,
not specifying a specific encoding.
|
EncodedResource(Resource resource,
String encoding)
Create a new EncodedResource for the given Resource,
using the specified encoding.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(Object obj) |
String |
getEncoding()
Return the encoding to use for reading from the resource,
or
null if none specified. |
Reader |
getReader()
Open a
java.io.Reader for the specified resource,
using the specified encoding (if any). |
Resource |
getResource()
Return the Resource held.
|
int |
hashCode() |
String |
toString() |
public EncodedResource(Resource resource)
resource - the Resource to holdpublic final Resource getResource()
public final String getEncoding()
null if none specified.public Reader getReader() throws IOException
java.io.Reader for the specified resource,
using the specified encoding (if any).IOException - if opening the Reader failed