|
|||||||||
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.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.lang.String s)
Constructor for Ant attribute introspection. |
Method Summary | |
---|---|
int |
compareTo(java.lang.Object another)
Compare this FileResource to another Resource. |
boolean |
equals(java.lang.Object another)
Compare another Object to this FileResource for equality. |
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. |
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 |
---|
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, 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.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()
public void setBaseDir(java.io.File b)
b
- the basedir as File.public java.io.File getBaseDir()
public void setRefid(Reference r)
setRefid
in class Resource
r
- the Reference to set.public java.lang.String getName()
getName
in class Resource
public boolean isExists()
isExists
in class Resource
public long getLastModified()
getLastModified
in class Resource
public boolean isDirectory()
isDirectory
in class Resource
public long getSize()
getSize
in class Resource
public java.io.InputStream getInputStream() throws java.io.IOException
getInputStream
in class Resource
java.io.IOException
- if an error occurs.public java.io.OutputStream getOutputStream() throws java.io.IOException
getOutputStream
in class Resource
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 int compareTo(java.lang.Object another)
compareTo
in interface java.lang.Comparable
compareTo
in class Resource
another
- the other Resource against which to compare.
public boolean equals(java.lang.Object another)
equals
in class Resource
another
- the other Object to compare.
public int hashCode()
hashCode
in class Resource
public java.lang.String toString()
toString
in class Resource
public boolean isFilesystemOnly()
isFilesystemOnly
in interface ResourceCollection
isFilesystemOnly
in class Resource
public void touch(long modTime)
touch
in interface Touchable
modTime
- new last modification time.protected java.io.File getNotNullFile()
BuildException
- if file is null.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |