Wraps around another resource, delegates all queries (except getSize) to that other resource but transforms stream content on the fly.
| Modifier and Type | Field and Description |
|---|---|
| private static final int |
| Access | Constructor and Description |
|---|---|
| protected | |
| protected | ContentTransformingResource(final ResourceCollection
the resource to wrap. other)Constructor with another resource to wrap. |
| Modifier and Type | Method and Description |
|---|---|
| public <T> T | as(final Class<T>
a class clazz)Overrides org. |
| public InputStream | Returns: an InputStream containing this Resource's content.Overrides org. |
| public OutputStream | Returns: an OutputStream to which content can be written.Overrides org. |
| public long | Returns: the size, as a long, 0 if the Resource does not exist (for compatibility with java.io.File), or UNKNOWN_SIZE if not known.Overrides org. |
| protected boolean | |
| protected abstract InputStream | Returns: a compressed InputStream.InputStream to wrap, will never be null. in)Get a content-filtering/transforming InputStream. |
| protected abstract OutputStream | Returns: a compressed OutputStream.OutputStream to wrap, will never be null. out)Get a content-filtering/transforming OutputStream. |
| BUFFER_SIZE | back to summary |
|---|---|
| private static final int BUFFER_SIZE | |
| ContentTransformingResource | back to summary |
|---|---|
| protected ContentTransformingResource() no arg constructor | |
| ContentTransformingResource | back to summary |
|---|---|
| protected ContentTransformingResource(final ResourceCollection other) Constructor with another resource to wrap.
| |
| as | back to summary |
|---|---|
| public <T> T as(final Class<T> clazz) Overrides org. Suppress FileProvider, re-implement Appendable
| |
| getInputStream | back to summary |
|---|---|
| public InputStream getInputStream() throws IOException Overrides org. Get an InputStream for the Resource.
| |
| getOutputStream | back to summary |
|---|---|
| public OutputStream getOutputStream() throws IOException Overrides org. Get an OutputStream for the Resource.
| |
| getSize | back to summary |
|---|---|
| public long getSize() Overrides org. Get the size of this Resource.
| |
| isAppendSupported | back to summary |
|---|---|
| protected boolean isAppendSupported() Learn whether the transformation performed allows appends. In general compressed outputs will become invalid if they are appended to, for example. This implementations returns false.
| |
| wrapStream | back to summary |
|---|---|
| protected abstract InputStream wrapStream(InputStream in) throws IOException Get a content-filtering/transforming InputStream.
| |
| wrapStream | back to summary |
|---|---|
| protected abstract OutputStream wrapStream(OutputStream out) throws IOException Get a content-filtering/transforming OutputStream.
| |