public class TarHeader extends Object
Offset Size Field 0 100 File name 100 8 File mode 108 8 Owner's numeric user ID 116 8 Group's numeric user ID 124 12 File size in bytes 136 12 Last modification time in numeric Unix time format 148 8 Checksum for header block 156 1 Link indicator (file type) 157 100 Name of linked fileFile Types
Value Meaning '0' Normal file (ASCII NUL) Normal file (now obsolete) '1' Hard link '2' Symbolic link '3' Character special '4' Block special '5' Directory '6' FIFO '7' ContigousUstar header
Offset Size Field 257 6 UStar indicator "ustar" 263 2 UStar version "00" 265 32 Owner user name 297 32 Owner group name 329 8 Device major number 337 8 Device minor number 345 155 Filename prefix
Modifier and Type | Field and Description |
---|---|
int |
checkSum |
static int |
CHKSUMLEN |
static int |
DEVLEN |
int |
devMajor |
int |
devMinor |
static int |
GIDLEN |
static int |
GNAMELEN |
static String |
GNU_TMAGIC
The magic tag representing a GNU tar archive.
|
int |
groupId |
StringBuffer |
groupName |
static byte |
LF_BLK |
static byte |
LF_CHR |
static byte |
LF_CONTIG |
static byte |
LF_DIR |
static byte |
LF_FIFO |
static byte |
LF_LINK |
static byte |
LF_NORMAL |
static byte |
LF_OLDNORM |
static byte |
LF_SYMLINK |
byte |
linkFlag |
StringBuffer |
linkName |
StringBuffer |
magic |
static int |
MAGICLEN |
int |
mode |
static int |
MODELEN |
long |
modTime |
static int |
MODTIMELEN |
StringBuffer |
name |
static int |
NAMELEN |
long |
size |
static int |
SIZELEN |
static String |
TMAGIC
The magic tag representing a POSIX tar archive.
|
static int |
UIDLEN |
static int |
UNAMELEN |
int |
userId |
StringBuffer |
userName |
Constructor and Description |
---|
TarHeader() |
Modifier and Type | Method and Description |
---|---|
static int |
getNameBytes(StringBuffer name,
byte[] buf,
int offset,
int length)
Determine the number of bytes in an entry name.
|
static StringBuffer |
parseName(byte[] header,
int offset,
int length)
Parse an entry name from a header buffer.
|
public static final int NAMELEN
public static final int MODELEN
public static final int UIDLEN
public static final int GIDLEN
public static final int SIZELEN
public static final int MODTIMELEN
public static final int CHKSUMLEN
public static final byte LF_OLDNORM
public static final byte LF_NORMAL
public static final byte LF_LINK
public static final byte LF_SYMLINK
public static final byte LF_CHR
public static final byte LF_BLK
public static final byte LF_DIR
public static final byte LF_FIFO
public static final byte LF_CONTIG
public static final int MAGICLEN
public static final String TMAGIC
public static final String GNU_TMAGIC
public static final int UNAMELEN
public static final int GNAMELEN
public static final int DEVLEN
public StringBuffer name
public int mode
public int userId
public int groupId
public long size
public long modTime
public int checkSum
public byte linkFlag
public StringBuffer linkName
public StringBuffer magic
public StringBuffer userName
public StringBuffer groupName
public int devMajor
public int devMinor
public static StringBuffer parseName(byte[] header, int offset, int length)
name
- header
- The header buffer from which to parse.offset
- The offset into the buffer from which to parse.length
- The number of header bytes to parse.public static int getNameBytes(StringBuffer name, byte[] buf, int offset, int length)
name
- header
- The header buffer from which to parse.offset
- The offset into the buffer from which to parse.length
- The number of header bytes to parse.