Maven module :un.storage : archive-tar :
Class :
un.storage.archive.tar.TarArchive
Extends/Implements :
un.storage.archive.tar.Object
Subclasses : -
Variables :
keepOldFiles,
asciiTranslate,
userId,
userName,
groupId,
groupName,
rootPath,
tempPath,
pathPrefix,
recordSize,
recordBuf,
tarIn,
tarOut,
transTyper
Functions :
TarArchive,
TarArchive,
TarArchive,
TarArchive,
TarArchive,
TarArchive,
setKeepOldFiles,
setAsciiTranslation,
setTransFileTyper,
setUserInfo,
getUserId,
getUserName,
getGroupId,
getGroupName,
getTempDirectory,
setTempDirectory,
getRecordSize,
closeArchive,
listContents,
extractContents,
writeEntry
protected boolean
keepOldFiles
protected boolean
asciiTranslate
protected int
userId
protected String
userName
protected int
groupId
protected String
groupName
protected String
rootPath
protected String
tempPath
protected String
pathPrefix
protected int
recordSize
protected byte[]
recordBuf
protected TarInputStream
tarIn
protected TarOutputStream
tarOut
protected TarTransFileTyper
transTyper
public void
TarArchive (ByteInputStream inStream)
public void
TarArchive (ByteInputStream inStream, int blockSize)
public void
TarArchive (ByteInputStream inStream, int blockSize, int recordSize)
public void
TarArchive (ByteOutputStream outStream)
public void
TarArchive (ByteOutputStream outStream, int blockSize)
public void
TarArchive (ByteOutputStream outStream, int blockSize, int recordSize)
public void
setKeepOldFiles (boolean keepOldFiles)
public void
setAsciiTranslation (boolean asciiTranslate)
public void
setTransFileTyper (TarTransFileTyper transTyper)
public void
setUserInfo (int userId, String userName, int groupId, String groupName)
public int
getUserId ()
public String
getUserName ()
public int
getGroupId ()
public String
getGroupName ()
public String
getTempDirectory ()
public void
setTempDirectory (String path)
public int
getRecordSize ()
public void
closeArchive ()
public void
listContents ()
public void
extractContents (File destDir)
public void
writeEntry (TarEntry oldEntry, boolean recurse)
is a series of entries, each of which represents a file system object. Each
entry in the archive consists of a header record. Directory entries consist
only of the header record, and are followed by entries for the directory's
contents. File entries consist of a header record followed by the number of
records needed to contain the file's contents. All entries are written on
record boundaries. Records are 512 bytes long.
TarArchives are instantiated in either read or write mode, based upon whether
they are instantiated with an InputStream or an OutputStream. Once
instantiated TarArchives read/write mode can not be changed.
There is currently no support for random access to tar archives. However, it
seems that subclassing TarArchive, and using the
TarBuffer.getCurrentRecordNum() and TarBuffer.getCurrentBlockNum() methods,
this would be rather trvial.
@author Timothy Gerard Endres,