Maven module :un.storage : archive-tar :
Class :
un.storage.archive.tar.TarEntry
Extends/Implements : -
Subclasses : -
Variables :
file,
header,
unixFormat,
ustarFormat,
gnuFormat
Functions :
TarEntry,
TarEntry,
TarEntry,
TarEntry,
isUSTarFormat,
setUSTarFormat,
isGNUTarFormat,
setGNUTarFormat,
isUnixTarFormat,
setUnixTarFormat,
equals,
isDescendent,
getHeader,
getName,
setName,
getUserId,
setUserId,
getGroupId,
setGroupId,
getUserName,
setUserName,
getGroupName,
setGroupName,
setIds,
setNames,
setModTime,
getFile,
getSize,
setSize,
isDirectory,
getFileTarHeader,
getDirectoryEntries,
computeCheckSum,
writeEntryHeader,
parseTarHeader,
nameTarHeader,
toString
protected File
file
protected TarHeader
header
protected boolean
unixFormat
protected boolean
ustarFormat
protected boolean
gnuFormat
public void
TarEntry (String name)
public void
TarEntry (File file)
public void
TarEntry (byte[] headerBuf)
public void
TarEntry (TarEntry toCopy)
public boolean
isUSTarFormat ()
public void
setUSTarFormat ()
public boolean
isGNUTarFormat ()
public void
setGNUTarFormat ()
public boolean
isUnixTarFormat ()
public void
setUnixTarFormat ()
public boolean
equals (TarEntry it)
public boolean
isDescendent (TarEntry desc)
public TarHeader
getHeader ()
public String
getName ()
public void
setName (String name)
public int
getUserId ()
public void
setUserId (int userId)
public int
getGroupId ()
public void
setGroupId (int groupId)
public String
getUserName ()
public void
setUserName (String userName)
public String
getGroupName ()
public void
setGroupName (String groupName)
public void
setIds (int userId, int groupId)
public void
setNames (String userName, String groupName)
public void
setModTime (long time)
public File
getFile ()
public long
getSize ()
public void
setSize (long size)
public boolean
isDirectory ()
public void
getFileTarHeader (TarHeader hdr, File file)
public TarEntry[]
getDirectoryEntries ()
public long
computeCheckSum (byte[] buf)
public void
writeEntryHeader (byte[] outbuf)
public void
parseTarHeader (TarHeader hdr, byte[] headerBuf)
public void
nameTarHeader (TarHeader hdr, String name)
public String
toString ()
header, as well as the entry's File. Entries can be instantiated in one of
three ways, depending on how they are to be used.
TarEntries that are
created from the header bytes read from an archive are instantiated with the
TarEntry( byte[] ) constructor. These entries will be used when extracting
from or listing the contents of an archive. These entries have their header
filled in using the header bytes. They also set the File to null, since they
reference an archive entry not a file.
TarEntries that are created from
Files that are to be written into an archive are instantiated with the
TarEntry( File ) constructor. These entries have their header filled in using
the File's information. They also keep a reference to the File for
convenience when writing entries.
Finally, TarEntries can be constructed
from nothing but a name. This allows the programmer to construct the entry by
hand, for instance when only an InputStream is available for writing to the
archive, and the header information is constructed from other information. In
this case the header fields are set to defaults and the File is set to null.
Note that while the class does recognize GNU formatted headers, it does not
perform proper processing of GNU archives. I hope to add the GNU support
someday.
Directory "size" fix contributed by: Bert Becker
@author Timothy Gerard Endres,