Resource implementation that holds a resource description
but does not point to an actually readable resource.
To be used as placeholder if a Resource argument is
expected by an API but not necessarily used for actual reading.
| Modifier and Type | Field and Description |
|---|---|
| private final String |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public boolean | equals(Object
the reference object with which to compare. other)Overrides org. |
| public boolean | exists()
Overrides org. Implements org. |
| public String | getDescription()
Implements org. |
| public InputStream | getInputStream()
Implements org. InputStream for the content of an underlying resource.
|
| public int | hashCode()
Overrides org. |
| public boolean | isReadable()
Overrides org. Overrides default org. true for a resource
that exists (revised as of 5.1).
|
| description | back to summary |
|---|---|
| private final String description | |
| DescriptiveResource | back to summary |
|---|---|
| public DescriptiveResource(String description) Create a new DescriptiveResource.
| |
| equals | back to summary |
|---|---|
| public boolean equals(Object other) Overrides org. This implementation compares the underlying description String.
| |
| exists | back to summary |
|---|---|
| public boolean exists() Overrides org. Implements org. Doc from org. This implementation checks whether a File can be opened, falling back to whether an InputStream can be opened. This will cover both directories and content resources.
| |
| getDescription | back to summary |
|---|---|
| public String getDescription() Implements org. Doc from org. Return a description for this resource, to be used for error output when working with the resource. Implementations are also encouraged to return this value
from their
| |
| getInputStream | back to summary |
|---|---|
| public InputStream getInputStream() throws IOException Implements org. Doc from org. Return an It is expected that each call creates a fresh stream. This requirement is particularly important when you consider an API such
as JavaMail, which needs to be able to read the stream multiple times when
creating mail attachments. For such a use case, it is required
that each
| |
| hashCode | back to summary |
|---|---|
| public int hashCode() Overrides org. This implementation returns the hash code of the underlying description String.
| |
| isReadable | back to summary |
|---|---|
| public boolean isReadable() Overrides org. Overrides default org. Doc from org. This implementation always returns
| |