@Override protected TarResource getCheckedRef() { return (TarResource) super.getCheckedRef(); }
/** * Get the archive that holds this Resource. * @return the archive as a Resource. */ public Resource getArchive() { return isReference() ? getCheckedRef().getArchive() : archive; }
/** * Get the file or dir mode for this Resource. * @return integer representation of Unix permission mask. */ public int getMode() { if (isReference()) { return getCheckedRef().getMode(); } checkEntry(); return mode; }
/** * Learn whether this Resource represents a directory. * @return boolean flag indicating whether the entry is a directory. */ @Override public boolean isDirectory() { if (isReference()) { return getCheckedRef().isDirectory(); } checkEntry(); return super.isDirectory(); }
/** * Compare another Object to this ArchiveResource for equality. * @param another the other Object to compare. * @return true if another is a Resource representing * the same entry in the same archive. */ @Override public boolean equals(Object another) { if (this == another) { return true; } if (isReference()) { return getCheckedRef().equals(another); } if (another == null || !another.getClass().equals(getClass())) { return false; } ArchiveResource r = (ArchiveResource) another; return getArchive().equals(r.getArchive()) && getName().equals(r.getName()); }
/** * Get the last modified date of this Resource. * @return the last modification date. */ @Override public long getLastModified() { if (isReference()) { return getCheckedRef().getLastModified(); } checkEntry(); return super.getLastModified(); }
/** * Find out whether this Resource represents an existing Resource. * @return boolean existence flag. */ @Override public boolean isExists() { if (isReference()) { return getCheckedRef().isExists(); } checkEntry(); return super.isExists(); }
/** * Get the size of this Resource. * @return the long size of this Resource. */ @Override public long getSize() { if (isReference()) { return getCheckedRef().getSize(); } checkEntry(); return super.getSize(); }
/** * Format this Resource as a String. * @return String representation of this Resource. */ @Override public String toString() { return isReference() ? getCheckedRef().toString() : getArchive().toString() + ':' + getName(); }