org.at4j.tar
Class TarEntry

java.lang.Object
  extended by org.at4j.archive.AbstractArchiveEntry<TarEntry,TarDirectoryEntry>
      extended by org.at4j.tar.TarEntry
All Implemented Interfaces:
ArchiveEntry<TarEntry,TarDirectoryEntry>, Lockable, ReadLockable, Named
Direct Known Subclasses:
TarDirectoryEntry, TarFileEntry, TarSymbolicLinkEntry

public abstract class TarEntry
extends AbstractArchiveEntry<TarEntry,TarDirectoryEntry>

This is the abstract base class for a Tar entry. It contains the metadata that is present in all Tar entries regardless of their types and the version of the Tar software that created them.

Tar entry objects are always immutable.

Since:
1.0
Author:
Karl Gustafsson

Method Summary
 int getChecksum()
          Get the entry's checksum.
protected abstract  UnixEntityMode getDefaultEntityMode()
          Subclasses implement this to return the default Unix entity mode if none is set in the Tar file.
 UnixEntityMode getEntityMode()
          Get the Unix entity mode for the entry.
 Date getLastModificationTime()
          Get the time of last modification for the file system entity that was added to the Tar file to create this Tar entry.
 int getOwnerGid()
          Get the owner group id for the entry.
 int getOwnerUid()
          Get the owner user id for the entry.
 
Methods inherited from class org.at4j.archive.AbstractArchiveEntry
getCollaborator, getLocation, getName, getParent, getReadLock, isReadLockedByCurrentThread, lockForReading
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getDefaultEntityMode

protected abstract UnixEntityMode getDefaultEntityMode()
Subclasses implement this to return the default Unix entity mode if none is set in the Tar file. This is called from the constructor.

Returns:
The default entity mode for the entry type.

getEntityMode

public UnixEntityMode getEntityMode()
Get the Unix entity mode for the entry. The Unix entity mode is the permissions settings for the entry.

Returns:
The Unix entity mode for the entry.

getOwnerUid

public int getOwnerUid()
Get the owner user id for the entry. This property allows a value range between 0 and 2097151. The actual range of the property depends on the Tar software and the operating system platform used when creating the archive.

Some entry versions support expressing the entry owner's user name in text. Software that interpret Tar file should let that text value take precedence over this numerical value.

Returns:
The owner user id for the entry.
See Also:
getOwnerGid()

getOwnerGid

public int getOwnerGid()
Get the owner group id for the entry. This property allows a value range between 0 and 2097151. The actual range of the property depends on the Tar software and the operating system platform used when creating the archive.

Some entry versions support expressing the entry owner's group name in text. Software that interpret Tar file should let that text value take precedence over this numerical value.

Returns:
The owner group id for the entry.
See Also:
getOwnerUid()

getLastModificationTime

public Date getLastModificationTime()
Get the time of last modification for the file system entity that was added to the Tar file to create this Tar entry.

The time zone for the timestamp is UTC.

Returns:
The last modification time.

getChecksum

public int getChecksum()
Get the entry's checksum. The checksum is calculated by adding together the values of all individual bytes in the Tar entry header, with the checksum field taken to be eight spaces.

This is a value in the range of 0 and 130560.

Returns:
The Tar entry's checksum.