org.at4j.zip
Class ZipSymbolicLinkEntry

java.lang.Object
  extended by org.at4j.archive.AbstractArchiveEntry<ZipEntry,ZipDirectoryEntry>
      extended by org.at4j.zip.ZipEntry
          extended by org.at4j.zip.ZipSymbolicLinkEntry
All Implemented Interfaces:
ArchiveEntry<ZipEntry,ZipDirectoryEntry>, ArchiveSymbolicLinkEntry<ZipEntry,ZipDirectoryEntry>, Lockable, ReadLockable, Named

public class ZipSymbolicLinkEntry
extends ZipEntry
implements ArchiveSymbolicLinkEntry<ZipEntry,ZipDirectoryEntry>

This object represents a symbolic link entry in a Zip archive. In addition to the properties inherited from ZipEntry, a symbolic link has a link target and a CRC 32 checksum calculated on the link value.

Zip entries are always immutable.

Since:
1.0
Author:
Karl Gustafsson
See Also:
ZipDirectoryEntry, ZipFileEntry

Constructor Summary
ZipSymbolicLinkEntry(ZipEntryCollaborator collaborator, ZipEntryCentralFileHeaderData zecd, ZipEntryLocalFileHeaderData zeld, Charset cs)
          Create a symbolic link entry.
 
Method Summary
 UnsignedInteger getCrc32()
          Get the CRC 32 checksum computed over the link target location.
 EntityLocation<?> getLinkTarget()
          Get the symbolic link's target.
 String toString()
           
 
Methods inherited from class org.at4j.zip.ZipEntry
getComment, getDiskNumberStart, getExternalFileAttributes, getExtraField, getExtraFields, getGeneralPurposeBitFlags, getLastModified, getVersionNeededToExtract, getVersionUsedToCreate, isEncrypted, isStrongEncryption
 
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, wait, wait, wait
 
Methods inherited from interface org.at4j.archive.ArchiveEntry
getLocation, getParent
 
Methods inherited from interface org.entityfs.Named
getName
 
Methods inherited from interface org.entityfs.lock.ReadLockable
getReadLock, isReadLockedByCurrentThread, lockForReading
 

Constructor Detail

ZipSymbolicLinkEntry

public ZipSymbolicLinkEntry(ZipEntryCollaborator collaborator,
                            ZipEntryCentralFileHeaderData zecd,
                            ZipEntryLocalFileHeaderData zeld,
                            Charset cs)
Create a symbolic link entry.

Parameters:
collaborator - The parent Zip archive's entry collaborator.
zecd - Data parsed from the Zip entry's central directory record.
zeld - Data parsed from the Zip entry's local header.
cs - The charset to use when decoding the link.
Method Detail

getLinkTarget

public EntityLocation<?> getLinkTarget()
Get the symbolic link's target. This is either an AbsoluteLocation or a RelativeLocation.

Specified by:
getLinkTarget in interface ArchiveSymbolicLinkEntry<ZipEntry,ZipDirectoryEntry>
Returns:
The symbolic link's target.

getCrc32

public UnsignedInteger getCrc32()
Get the CRC 32 checksum computed over the link target location.

Returns:
The CRC32 checksum.

toString

public String toString()
Overrides:
toString in class Object