Methods Summary |
---|
public void | addConfigured(org.apache.tools.ant.types.ResourceCollection a)Sets the archive that holds this as a single element Resource
collection.
checkChildrenAllowed();
if (archive != null) {
throw new BuildException("you must not specify more than one"
+ " archive");
}
if (a.size() != 1) {
throw new BuildException("only single argument resource collections"
+ " are supported as archives");
}
archive = (Resource) a.iterator().next();
|
private synchronized void | checkEntry()
if (haveEntry) {
return;
}
String name = getName();
if (name == null) {
throw new BuildException("entry name not set");
}
Resource r = getArchive();
if (r == null) {
throw new BuildException("archive attribute not set");
}
if (!r.isExists()) {
throw new BuildException(r.toString() + " does not exist.");
}
if (r.isDirectory()) {
throw new BuildException(r + " denotes a directory.");
}
fetchEntry();
haveEntry = true;
|
public int | compareTo(java.lang.Object another)Compare this ArchiveResource to another Resource.
return this.equals(another) ? 0 : super.compareTo(another);
|
public boolean | equals(java.lang.Object another)Compare another Object to this ArchiveResource for equality.
if (this == another) {
return true;
}
if (isReference()) {
return getCheckedRef().equals(another);
}
if (!(another.getClass().equals(getClass()))) {
return false;
}
ArchiveResource r = (ArchiveResource) another;
return getArchive().equals(r.getArchive())
&& getName().equals(r.getName());
|
protected abstract void | fetchEntry()fetches information from the named entry inside the archive.
|
public org.apache.tools.ant.types.Resource | getArchive()Get the archive that holds this Resource.
return isReference()
? ((ArchiveResource) getCheckedRef()).getArchive() : archive;
|
public long | getLastModified()Get the last modified date of this Resource.
if (isReference()) {
return ((Resource) getCheckedRef()).getLastModified();
}
checkEntry();
return super.getLastModified();
|
public int | getMode()Get the file or dir mode for this Resource.
if (isReference()) {
return ((ArchiveResource) getCheckedRef()).getMode();
}
checkEntry();
return mode;
|
public long | getSize()Get the size of this Resource.
if (isReference()) {
return ((Resource) getCheckedRef()).getSize();
}
checkEntry();
return super.getSize();
|
public int | hashCode()Get the hash code for this Resource.
return super.hashCode()
* (getArchive() == null ? NULL_ARCHIVE : getArchive().hashCode());
|
public boolean | isDirectory()Learn whether this Resource represents a directory.
if (isReference()) {
return ((Resource) getCheckedRef()).isDirectory();
}
checkEntry();
return super.isDirectory();
|
public boolean | isExists()Find out whether this Resource represents an existing Resource.
if (isReference()) {
return ((Resource) getCheckedRef()).isExists();
}
checkEntry();
return super.isExists();
|
public void | setArchive(java.io.File a)Set the archive that holds this Resource.
checkAttributesAllowed();
archive = new FileResource(a);
|
public void | setMode(int mode)Sets the file or dir mode for this resource.
checkAttributesAllowed();
this.mode = mode;
modeSet = true;
|
public void | setRefid(org.apache.tools.ant.types.Reference r)Overrides the super version.
if (archive != null || modeSet) {
throw tooManyAttributes();
}
super.setRefid(r);
|
public java.lang.String | toString()Format this Resource as a String.
return isReference() ? getCheckedRef().toString()
: getArchive().toString() + ':" + getName();
|