Resource descriptor with a specific encoding
or Charset to be used for reading from the resource.
Used as an argument for operations that support reading content with
a specific encoding, typically via a java.io.Reader.
Resource#getInputStream(), java.io.Reader , java.nio.charset.Charset
| Modifier and Type | Field and Description |
|---|---|
| private final Charset | |
| private final String | |
| private final Resource |
| Access | Constructor and Description |
|---|---|
| public | EncodedResource(Resource
the resource)Resource to hold (never null)Create a new |
| public | EncodedResource(Resource
the resource, String Resource to hold (never null)the encoding to use for reading from the resource encoding)Create a new |
| public | EncodedResource(Resource
the resource, Charset Resource to hold (never null)the charset)Charset to use for reading from the resourceCreate a new |
| private |
| Modifier and Type | Method and Description |
|---|---|
| public boolean | equals(Object
the reference object with which to compare. other)Overrides java. |
| public final Charset | |
| public String | getContentAsString()
Returns the contents of the specified resource as a string, using the specified
|
| public final String | |
| public InputStream | getInputStream()
Implements org. InputStream for the specified resource, ignoring any specified
Charset or encoding.
|
| public Reader | |
| public final Resource | |
| public int | |
| public boolean | requiresReader()
Determine whether a |
| public String |
| charset | back to summary |
|---|---|
| private final Charset charset
| |
| encoding | back to summary |
|---|---|
| private final String encoding
| |
| resource | back to summary |
|---|---|
| private final Resource resource | |
| EncodedResource | back to summary |
|---|---|
| public EncodedResource(Resource resource) Create a new
| |
| EncodedResource | back to summary |
|---|---|
| public EncodedResource(Resource resource, String encoding) Create a new | |
| EncodedResource | back to summary |
|---|---|
| public EncodedResource(Resource resource, Charset charset) Create a new | |
| EncodedResource | back to summary |
|---|---|
| private EncodedResource(Resource resource, String encoding, Charset charset) | |
| equals | back to summary |
|---|---|
| public boolean equals(Object other) Overrides java. Doc from java. Indicates whether some other object is "equal to" this one.
The
An equivalence relation partitions the elements it operates on into equivalence classes; all the members of an equivalence class are equal to each other. Members of an equivalence class are substitutable for each other, at least for some purposes. | |
| getCharset | back to summary |
|---|---|
| public final Charset getCharset() Return the
| |
| getContentAsString | back to summary |
|---|---|
| public String getContentAsString() throws IOException Returns the contents of the specified resource as a string, using the specified
| |
| getEncoding | back to summary |
|---|---|
| public final String getEncoding() Return the encoding to use for reading from the resource,
or
| |
| getInputStream | back to summary |
|---|---|
| public InputStream getInputStream() throws IOException Implements org. Open an
| |
| getReader | back to summary |
|---|---|
| public Reader getReader() throws IOException Open a
| |
| getResource | back to summary |
|---|---|
| public final Resource getResource() Return the | |
| hashCode | back to summary |
|---|---|
| public int hashCode() Overrides java. Doc from java. Returns a hash code value for the object. This method is
supported for the benefit of hash tables such as those provided by
The general contract of
| |
| requiresReader | back to summary |
|---|---|
| public boolean requiresReader() Determine whether a
| |
| toString | back to summary |
|---|---|
| public String toString() Overrides java. Doc from java. Returns a string representation of the object. | |