Class TarHeader
java.lang.Object
com.codename1.io.tar.TarHeader
Header
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 file
File 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' Contigous
Ustar 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
-
Field Summary
FieldsModifier and TypeFieldDescriptionintstatic final intstatic final intintintstatic final intstatic final intstatic final StringThe magic tag representing a GNU tar archive.intstatic final bytestatic final bytestatic final bytestatic final bytestatic final bytestatic final bytestatic final bytestatic final bytestatic final bytebytestatic final intintstatic final intlongstatic final intstatic final intlongstatic final intstatic final StringThe magic tag representing a POSIX tar archive.static final intstatic final intint -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic intgetNameBytes(StringBuffer name, byte[] buf, int offset, int length) Determine the number of bytes in an entry name.static StringBufferparseName(byte[] header, int offset, int length) Parse an entry name from a header buffer.
-
Field Details
-
NAMELEN
public static final int NAMELEN- See Also:
-
MODELEN
public static final int MODELEN- See Also:
-
UIDLEN
public static final int UIDLEN- See Also:
-
GIDLEN
public static final int GIDLEN- See Also:
-
SIZELEN
public static final int SIZELEN- See Also:
-
MODTIMELEN
public static final int MODTIMELEN- See Also:
-
CHKSUMLEN
public static final int CHKSUMLEN- See Also:
-
LF_OLDNORM
public static final byte LF_OLDNORM- See Also:
-
LF_NORMAL
public static final byte LF_NORMAL- See Also:
-
LF_LINK
public static final byte LF_LINK- See Also:
-
LF_SYMLINK
public static final byte LF_SYMLINK- See Also:
-
LF_CHR
public static final byte LF_CHR- See Also:
-
LF_BLK
public static final byte LF_BLK- See Also:
-
LF_DIR
public static final byte LF_DIR- See Also:
-
LF_FIFO
public static final byte LF_FIFO- See Also:
-
LF_CONTIG
public static final byte LF_CONTIG- See Also:
-
MAGICLEN
public static final int MAGICLEN- See Also:
-
TMAGIC
-
GNU_TMAGIC
-
UNAMELEN
public static final int UNAMELEN- See Also:
-
GNAMELEN
public static final int GNAMELEN- See Also:
-
DEVLEN
public static final int DEVLEN- See Also:
-
name
-
mode
public int mode -
userId
public int userId -
groupId
public int groupId -
size
public long size -
modTime
public long modTime -
checkSum
public int checkSum -
linkFlag
public byte linkFlag -
linkName
-
magic
-
userName
-
groupName
-
devMajor
public int devMajor -
devMinor
public int devMinor
-
-
Constructor Details
-
TarHeader
public TarHeader()
-
-
Method Details
-
parseName
Parse an entry name from a header buffer.
Parameters
-
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.
Returns
The header's entry name.
-
-
getNameBytes
Determine the number of bytes in an entry name.
Parameters
-
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.
Returns
The number of bytes in a header's entry name.
-
-