public class PosixTarEntry extends TarEntry
The C structure for a USTar Entry's header is:
struct posix_header
{
char name[100]; //File name. Null-terminated if room.
char mode[8]; //Permissions as octal string.
char uid[8]; //User ID as octal string.
char gid[8]; //Group ID as octal string.
char size[12]; //File size in bytes as octal string.
char mtime[12]; //Modification time in seconds
// from Jan 1, 1970, as octal string.
char chksum[8]; //Sum of octets in header as octal string.
char typeflag; //An enum ustar_type value.
char linkname[100]; //Name of link target.
// Null-terminated if room.
char magic[6]; //"ustar\0"
char version[2]; //"00"
char uname[32]; //User name, always null-terminated.
char gname[32]; //Group name, always null-terminated.
char devmajor[8]; //Device major number as octal string.
char devminor[8]; //Device minor number as octal string.
char prefix[155]; //Prefix to file name.
// Null-terminated if room.
};
Actually the posix_header structure is the same with an exception of padding -
not present in posix_header.
Modifier and Type | Field and Description |
---|---|
protected StringBuffer |
prefix
A prefix fo the file name.
|
protected StringBuffer |
version
A version of the ustar.
|
checkSum, DEFAULT_DIR_MODE, DEFAULT_FILE_MODE, devMajor, devMinor, file, groupId, groupName, linkFlag, linkName, magic, MAX_NAMELEN, MILLIS_PER_SECOND, mode, modTime, name, size, userId, userName
CHKSUMLEN, DEVLEN, GIDLEN, GNAMELEN, GNU_LONGLINK, GNU_TMAGIC, LF_BLK, LF_CHR, LF_CONTIG, LF_DIR, LF_FIFO, LF_GNUTYPE_LONGNAME, LF_LINK, LF_NORMAL, LF_OLDNORM, LF_SYMLINK, MAGICLEN, MODELEN, MODTIMELEN, NAMELEN, POSIX_MAGICLEN, POSIX_PREFIXLEN, POSIX_TMAGIC, POSIX_VERSION, POSIX_VERSIONLEN, SIZELEN, TMAGIC, UIDLEN, UNAMELEN
Constructor and Description |
---|
PosixTarEntry(File file) |
PosixTarEntry(String name) |
PosixTarEntry(String name,
byte linkFlag) |
Modifier and Type | Method and Description |
---|---|
protected void |
initPOSIXTar()
Initializes the ustar extra header fields.
|
void |
parseTarHeader(byte[] header)
Parse an entry's header information from a header buffer.
|
void |
writeEntryHeader(byte[] outbuf)
Write an entry's header information to a header buffer.
|
equals, equals, getChecksum, getDirectoryEntries, getFile, getGroupId, getGroupName, getLastModificationTime, getLinkName, getMode, getModTime, getName, getSize, getUserId, getUserName, hashCode, isDescendent, isDirectory, isGNULongNameEntry, setGroupId, setGroupName, setIds, setMode, setModTime, setModTime, setName, setNames, setSize, setUserId, setUserName
protected StringBuffer prefix
protected StringBuffer version
public PosixTarEntry(String name)
public PosixTarEntry(File file)
public PosixTarEntry(String name, byte linkFlag)
protected void initPOSIXTar()
public void writeEntryHeader(byte[] outbuf)
writeEntryHeader
in class TarEntry
outbuf
- The tar entry header buffer to fill in.public void parseTarHeader(byte[] header)
parseTarHeader
in class TarEntry
header
- The tar entry header buffer to get information from.Copyright © 2001-2013 Codehaus. All Rights Reserved.