|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object | +--org.apache.tools.ant.types.Resource
Describes a File or a ZipEntry. This class is meant to be used by classes needing to record path and date/time information about a file, a zip entry or some similar resource (URL, archive in a version control repository, ...).
| Field Summary | |
static long |
UNKNOWN_SIZE
Constant unknown size |
| Constructor Summary | |
Resource()
Default constructor. |
|
Resource(java.lang.String name)
Only sets the name. |
|
Resource(java.lang.String name,
boolean exists,
long lastmodified)
Sets the name, lastmodified flag, and exists flag. |
|
Resource(java.lang.String name,
boolean exists,
long lastmodified,
boolean directory)
Sets the name, lastmodified flag, exists flag, and directory flag. |
|
Resource(java.lang.String name,
boolean exists,
long lastmodified,
boolean directory,
long size)
Sets the name, lastmodified flag, exists flag, directory flag, and size. |
|
| Method Summary | |
java.lang.Object |
clone()
Clone this Resource. |
int |
compareTo(java.lang.Object other)
Delegates to a comparison of names. |
long |
getLastModified()
Tells the modification time in milliseconds since 01.01.1970 . |
java.lang.String |
getName()
Name attribute will contain the path of a file relative to the root directory of its fileset or the recorded path of a zip entry. |
long |
getSize()
Get the size of this Resource. |
boolean |
isDirectory()
Tells if the resource is a directory. |
boolean |
isExists()
The exists attribute tells whether a file exists. |
void |
setDirectory(boolean directory)
Set the directory attribute. |
void |
setExists(boolean exists)
Set the exists attribute. |
void |
setLastModified(long lastmodified)
Set the last modification attribute. |
void |
setName(java.lang.String name)
Set the name of this Resource. |
void |
setSize(long size)
Set the size of this Resource. |
| Methods inherited from class java.lang.Object |
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
public static final long UNKNOWN_SIZE
| Constructor Detail |
public Resource()
public Resource(java.lang.String name)
This is a dummy, used for not existing resources.
name - relative path of the resource. Expects
"/" to be used as the directory separator.
public Resource(java.lang.String name,
boolean exists,
long lastmodified)
name - relative path of the resource. Expects
"/" to be used as the directory separator.exists - if true, this resource exists.lastmodified - the last modification time of this resource.
public Resource(java.lang.String name,
boolean exists,
long lastmodified,
boolean directory)
name - relative path of the resource. Expects
"/" to be used as the directory separator.exists - if true the resource existslastmodified - the last modification time of the resourcedirectory - if true, this resource is a directory
public Resource(java.lang.String name,
boolean exists,
long lastmodified,
boolean directory,
long size)
name - relative path of the resource. Expects
"/" to be used as the directory separator.exists - if true the resource existslastmodified - the last modification time of the resourcedirectory - if true, this resource is a directorysize - the size of this resource.| Method Detail |
public java.lang.String getName()
example for a file with fullpath /var/opt/adm/resource.txt in a file set with root dir /var/opt it will be adm/resource.txt.
"/" will be used as the directory separator.
public void setName(java.lang.String name)
name - relative path of the resource. Expects
"/" to be used as the directory separator.public boolean isExists()
public void setExists(boolean exists)
exists - if true, this resource exists.public long getLastModified()
File.public void setLastModified(long lastmodified)
lastmodified - the modification time in milliseconds since 01.01.1970.public boolean isDirectory()
public void setDirectory(boolean directory)
directory - if true, this resource is a directory.public void setSize(long size)
size - the size, as a long.public long getSize()
public java.lang.Object clone()
clone in class java.lang.Objectpublic int compareTo(java.lang.Object other)
compareTo in interface java.lang.Comparableother - the object to compare to.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||