org.apache.tools.ant.types.resources
public abstract class ResourceDecorator extends Resource
Overwrites all setters to throw exceptions.
Since: Ant 1.8.0
| Constructor Summary | |
|---|---|
| protected | ResourceDecorator() no arg constructor |
| protected | ResourceDecorator(ResourceCollection other)
Constructor with another resource to wrap. |
| Method Summary | |
|---|---|
| void | addConfigured(ResourceCollection a)
Sets the resource to wrap using a single-element collection. |
| Object | as(Class clazz) |
| int | compareTo(Object other) |
| protected void | dieOnCircularReference(Stack stack, Project project) |
| InputStream | getInputStream()
Get an InputStream for the Resource. |
| long | getLastModified()
Tells the modification time in milliseconds since 01.01.1970 .
|
| String | getName()
Get the name of the resource. |
| OutputStream | getOutputStream()
Get an OutputStream for the Resource. |
| protected Resource | getResource()
De-references refids if any, ensures a wrapped resource has
been specified. |
| long | getSize()
Get the size of this Resource. |
| int | hashCode()
Get the hash code for this Resource. |
| boolean | isDirectory()
Tells if the resource is a directory. |
| boolean | isExists()
The exists attribute tells whether a file exists. |
| boolean | isFilesystemOnly()
Fulfill the ResourceCollection contract. |
| void | setDirectory(boolean directory)
Override setDirectory. |
| void | setExists(boolean exists)
Set the exists attribute. |
| void | setLastModified(long lastmodified)
Override setLastModified. |
| void | setName(String name)
Overridden, not allowed to set the name of the resource. |
| void | setRefid(Reference r)
Overrides the base version. |
| void | setSize(long size)
Override setSize. |
Parameters: other the resource to wrap.
Parameters: a the resource to wrap as a single element Resource collection.
Returns: an InputStream containing this Resource's content.
Throws: IOException if unable to provide the content of this Resource as a stream. UnsupportedOperationException if InputStreams are not supported for this Resource type.
Returns: 0 if the resource does not exist to mirror the behavior
of java.io.File File.
Returns: the name of the wrapped resource.
Returns: an OutputStream to which content can be written.
Throws: IOException if unable to provide the content of this Resource as a stream. UnsupportedOperationException if OutputStreams are not supported for this Resource type.
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.
Returns: hash code as int.
Returns: boolean flag indicating if the resource is a directory.
Returns: true if this resource exists.
Returns: whether this Resource is a FileProvider.
Parameters: directory not used.
Throws: BuildException always.
Parameters: exists if true, this resource exists.
Parameters: lastmodified not used.
Throws: BuildException always.
Parameters: name not used.
Throws: BuildException always.
Parameters: r the Reference to set.
Parameters: size not used.
Throws: BuildException always.