public abstract class ArchiveResource extends Resource
MAGIC, UNKNOWN_DATETIME, UNKNOWN_SIZE
description, location, project
Modifier | Constructor and Description |
---|---|
protected |
ArchiveResource()
Default constructor.
|
protected |
ArchiveResource(java.io.File a)
Construct a ArchiveResource representing the specified
entry in the specified archive.
|
protected |
ArchiveResource(java.io.File a,
boolean withEntry)
Construct a ArchiveResource representing the specified
entry in the specified archive.
|
protected |
ArchiveResource(Resource a,
boolean withEntry)
Construct a ArchiveResource representing the specified
entry in the specified archive.
|
Modifier and Type | Method and Description |
---|---|
void |
addConfigured(ResourceCollection a)
Sets the archive that holds this as a single element Resource
collection.
|
protected void |
checkEntry()
Validate settings and ensure that the represented "archive entry"
has been established.
|
int |
compareTo(Resource another)
Compare this ArchiveResource to another Resource.
|
protected void |
dieOnCircularReference(java.util.Stack<java.lang.Object> stk,
Project p)
Check to see whether any DataType we hold references to is
included in the Stack (which holds all DataType instances that
directly or indirectly reference this instance, including this
instance itself).
|
boolean |
equals(java.lang.Object another)
Compare another Object to this ArchiveResource for equality.
|
protected abstract void |
fetchEntry()
Fetch information from the named entry inside the archive.
|
Resource |
getArchive()
Get the archive that holds this Resource.
|
long |
getLastModified()
Get the last modified date of this Resource.
|
int |
getMode()
Get the file or dir mode for this Resource.
|
long |
getSize()
Get the size of this Resource.
|
int |
hashCode()
Get the hash code for this Resource.
|
boolean |
isDirectory()
Learn whether this Resource represents a directory.
|
boolean |
isExists()
Find out whether this Resource represents an existing Resource.
|
void |
setArchive(java.io.File a)
Set the archive that holds this Resource.
|
void |
setMode(int mode)
Sets the file or dir mode for this resource.
|
void |
setRefid(Reference r)
Overrides the super version.
|
java.lang.String |
toString()
Format this Resource as a String.
|
as, clone, getInputStream, getMagicNumber, getName, getOutputStream, isFilesystemOnly, iterator, setDirectory, setExists, setLastModified, setName, setSize, size, toLongString
checkAttributesAllowed, checkChildrenAllowed, circularReference, dieOnCircularReference, dieOnCircularReference, getCheckedRef, getCheckedRef, getCheckedRef, getCheckedRef, getDataTypeName, getRefid, invokeCircularReferenceCheck, isChecked, isReference, noChildrenAllowed, pushAndInvokeCircularReferenceCheck, setChecked, tooManyAttributes
getDescription, getLocation, getProject, log, log, setDescription, setLocation, setProject
protected ArchiveResource()
protected ArchiveResource(java.io.File a)
a
- the archive as File.protected ArchiveResource(java.io.File a, boolean withEntry)
a
- the archive as File.withEntry
- if the entry has been specified.protected ArchiveResource(Resource a, boolean withEntry)
a
- the archive as Resource.withEntry
- if the entry has been specified.public void setArchive(java.io.File a)
a
- the archive as a File.public void setMode(int mode)
mode
- integer representation of Unix permission mask.public void addConfigured(ResourceCollection a)
a
- the archive as a single element Resource collection.public Resource getArchive()
public long getLastModified()
getLastModified
in class Resource
public long getSize()
public boolean isDirectory()
isDirectory
in class Resource
public boolean isExists()
public int getMode()
public void setRefid(Reference r)
public int compareTo(Resource another)
compareTo
in interface java.lang.Comparable<Resource>
compareTo
in class Resource
another
- the other Resource against which to compare.public boolean equals(java.lang.Object another)
public int hashCode()
public java.lang.String toString()
protected final void checkEntry() throws BuildException
BuildException
protected abstract void fetchEntry()
protected void dieOnCircularReference(java.util.Stack<java.lang.Object> stk, Project p)
If one is included, throw a BuildException created by circularReference
.
This implementation is appropriate only for a DataType that cannot hold other DataTypes as children.
The general contract of this method is that it shouldn't do
anything if DataType.checked
is true and
set it to true on exit.
dieOnCircularReference
in class DataType
stk
- the stack of references to check.p
- the project to use to dereference the references.