|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.tools.ant.ProjectComponent org.apache.tools.ant.types.DataType org.apache.tools.ant.types.Resource org.apache.tools.ant.types.resources.ResourceDecorator org.apache.tools.ant.types.resources.ContentTransformingResource
public abstract class ContentTransformingResource
A resource that transforms the content of another resource.
Wraps around another resource, delegates all queries (except getSize) to that other resource but transforms stream content on the fly.
Field Summary |
---|
Fields inherited from class org.apache.tools.ant.types.Resource |
---|
MAGIC, UNKNOWN_DATETIME, UNKNOWN_SIZE |
Fields inherited from class org.apache.tools.ant.types.DataType |
---|
checked, ref |
Fields inherited from class org.apache.tools.ant.ProjectComponent |
---|
description, location, project |
Constructor Summary | |
---|---|
protected |
ContentTransformingResource()
no arg constructor |
protected |
ContentTransformingResource(ResourceCollection other)
Constructor with another resource to wrap. |
Method Summary | ||
---|---|---|
|
as(java.lang.Class<T> clazz)
Suppress FileProvider, re-implement Appendable |
|
java.io.InputStream |
getInputStream()
Get an InputStream for the Resource. |
|
java.io.OutputStream |
getOutputStream()
Get an OutputStream for the Resource. |
|
long |
getSize()
Get the size of this Resource. |
|
protected boolean |
isAppendSupported()
Learn whether the transformation performed allows appends. |
|
protected abstract java.io.InputStream |
wrapStream(java.io.InputStream in)
Get a content-filtering/transforming InputStream. |
|
protected abstract java.io.OutputStream |
wrapStream(java.io.OutputStream out)
Get a content-filtering/transforming OutputStream. |
Methods inherited from class org.apache.tools.ant.types.resources.ResourceDecorator |
---|
addConfigured, compareTo, dieOnCircularReference, getLastModified, getName, getResource, hashCode, isDirectory, isExists, isFilesystemOnly, setDirectory, setExists, setLastModified, setName, setRefid, setSize |
Methods inherited from class org.apache.tools.ant.types.Resource |
---|
clone, equals, getMagicNumber, iterator, size, toLongString, toString |
Methods inherited from class org.apache.tools.ant.types.DataType |
---|
checkAttributesAllowed, checkChildrenAllowed, circularReference, dieOnCircularReference, dieOnCircularReference, getCheckedRef, getCheckedRef, getCheckedRef, getCheckedRef, getDataTypeName, getRefid, invokeCircularReferenceCheck, isChecked, isReference, noChildrenAllowed, pushAndInvokeCircularReferenceCheck, setChecked, tooManyAttributes |
Methods inherited from class org.apache.tools.ant.ProjectComponent |
---|
getDescription, getLocation, getProject, log, log, setDescription, setLocation, setProject |
Methods inherited from class java.lang.Object |
---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
protected ContentTransformingResource()
protected ContentTransformingResource(ResourceCollection other)
other
- the resource to wrap.Method Detail |
---|
public long getSize()
getSize
in class ResourceDecorator
public java.io.InputStream getInputStream() throws java.io.IOException
getInputStream
in class ResourceDecorator
java.io.IOException
- if unable to provide the content of this
Resource as a stream.
java.lang.UnsupportedOperationException
- if InputStreams are not
supported for this Resource type.public java.io.OutputStream getOutputStream() throws java.io.IOException
getOutputStream
in class ResourceDecorator
java.io.IOException
- if unable to provide the content of this
Resource as a stream.
java.lang.UnsupportedOperationException
- if OutputStreams are not
supported for this Resource type.public <T> T as(java.lang.Class<T> clazz)
as
in class ResourceDecorator
protected boolean isAppendSupported()
In general compressed outputs will become invalid if they are appended to, for example.
This implementations returns false.
protected abstract java.io.InputStream wrapStream(java.io.InputStream in) throws java.io.IOException
in
- InputStream to wrap, will never be null.
java.io.IOException
- if there is a problem.protected abstract java.io.OutputStream wrapStream(java.io.OutputStream out) throws java.io.IOException
out
- OutputStream to wrap, will never be null.
java.io.IOException
- if there is a problem.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |