|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.apache.tools.ant.ProjectComponent
org.apache.tools.ant.types.DataType
org.apache.tools.ant.types.Resource
org.apache.tools.ant.types.resources.FileResource
public class FileResource
A Resource representation of a File.
| 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 | |
|---|---|
FileResource()
Default constructor. |
|
FileResource(java.io.File f)
Construct a new FileResource from a File. |
|
FileResource(java.io.File b,
java.lang.String name)
Construct a new FileResource using the specified basedir and relative name. |
|
FileResource(Project p,
java.io.File f)
Create a new FileResource. |
|
FileResource(Project p,
java.lang.String s)
Constructor for Ant attribute introspection. |
|
| Method Summary | |
|---|---|
int |
compareTo(Resource another)
Compare this FileResource to another Resource. |
boolean |
equals(java.lang.Object another)
Compare another Object to this FileResource for equality. |
java.io.OutputStream |
getAppendOutputStream()
Get an appending OutputStream. |
java.io.File |
getBaseDir()
Return the basedir to which the name is relative. |
java.io.File |
getFile()
Get the file represented by this FileResource. |
java.io.InputStream |
getInputStream()
Return an InputStream for reading the contents of this Resource. |
long |
getLastModified()
Get the modification time in milliseconds since 01.01.1970 . |
java.lang.String |
getName()
Get the name of this FileResource. |
protected java.io.File |
getNotNullFile()
Get the file represented by this FileResource, ensuring it is not null. |
java.io.OutputStream |
getOutputStream()
Get an OutputStream for the Resource. |
Resource |
getResource(java.lang.String path)
Create a new resource that matches a relative or absolute path. |
long |
getSize()
Get the size of this Resource. |
int |
hashCode()
Get the hash code for this Resource. |
boolean |
isDirectory()
Learn whether the resource is a directory. |
boolean |
isExists()
Learn whether this file exists. |
boolean |
isFilesystemOnly()
Fulfill the ResourceCollection contract. |
void |
setBaseDir(java.io.File b)
Set the basedir for this FileResource. |
void |
setFile(java.io.File f)
Set the File for this FileResource. |
void |
setRefid(Reference r)
Overrides the super version. |
java.lang.String |
toString()
Get the string representation of this Resource. |
void |
touch(long modTime)
Implement the Touchable interface. |
| Methods inherited from class org.apache.tools.ant.types.Resource |
|---|
as, clone, getMagicNumber, iterator, setDirectory, setExists, setLastModified, setName, setSize, size, toLongString |
| Methods inherited from class org.apache.tools.ant.types.DataType |
|---|
checkAttributesAllowed, checkChildrenAllowed, circularReference, dieOnCircularReference, 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 |
|---|
public FileResource()
public FileResource(java.io.File b,
java.lang.String name)
b - the basedir as File.name - the relative filename.public FileResource(java.io.File f)
f - the File represented.
public FileResource(Project p,
java.io.File f)
p - Projectf - File represented
public FileResource(Project p,
java.lang.String s)
p - the Project against which to resolve s.s - the absolute or Project-relative filename as a String.IntrospectionHelper| Method Detail |
|---|
public void setFile(java.io.File f)
f - the File to be represented.public java.io.File getFile()
getFile in interface FileProviderpublic void setBaseDir(java.io.File b)
b - the basedir as File.public java.io.File getBaseDir()
public void setRefid(Reference r)
setRefid in class Resourcer - the Reference to set.public java.lang.String getName()
getName in class Resourcepublic boolean isExists()
isExists in class Resourcepublic long getLastModified()
getLastModified in class Resourcepublic boolean isDirectory()
isDirectory in class Resourcepublic long getSize()
getSize in class Resource
public java.io.InputStream getInputStream()
throws java.io.IOException
getInputStream in class Resourcejava.io.IOException - if an error occurs.
public java.io.OutputStream getOutputStream()
throws java.io.IOException
getOutputStream in class Resourcejava.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 java.io.OutputStream getAppendOutputStream()
throws java.io.IOException
getAppendOutputStream in interface Appendablejava.io.IOException - if anything goes wrongpublic int compareTo(Resource another)
compareTo in interface java.lang.Comparable<Resource>compareTo in class Resourceanother - the other Resource against which to compare.
public boolean equals(java.lang.Object another)
equals in class Resourceanother - the other Object to compare.
public int hashCode()
hashCode in class Resourcepublic java.lang.String toString()
toString in class Resourcepublic boolean isFilesystemOnly()
isFilesystemOnly in interface ResourceCollectionisFilesystemOnly in class Resourcepublic void touch(long modTime)
touch in interface TouchablemodTime - new last modification time.protected java.io.File getNotNullFile()
BuildException - if file is null.public Resource getResource(java.lang.String path)
getResource in interface ResourceFactorypath - relative/absolute path to a resource
BuildException - if desired
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||