Class TarArchiveSparseEntry
java.lang.Object
org.apache.tools.tar.TarArchiveSparseEntry
- All Implemented Interfaces:
TarConstants
This class represents a sparse entry in a Tar archive.
The C structure for a sparse entry is:
struct posix_header {
struct sparse sp[21]; // TarConstants.SPARSELEN_GNU_SPARSE - offset 0
char isextended; // TarConstants.ISEXTENDEDLEN_GNU_SPARSE - offset 504
};
Whereas, "struct sparse" is:
struct sparse {
char offset[12]; // offset 0
char numbytes[12]; // offset 12
};
-
Field Summary
Fields inherited from interface TarConstants
ATIMELEN_GNU, CHKSUMLEN, CTIMELEN_GNU, DEVLEN, FORMAT_OLDGNU, FORMAT_POSIX, GIDLEN, GNAMELEN, GNU_LONGLINK, GNU_TMAGIC, ISEXTENDEDLEN_GNU, ISEXTENDEDLEN_GNU_SPARSE, LF_BLK, LF_CHR, LF_CONTIG, LF_DIR, LF_FIFO, LF_GNUTYPE_LONGLINK, LF_GNUTYPE_LONGNAME, LF_GNUTYPE_SPARSE, LF_LINK, LF_NORMAL, LF_OLDNORM, LF_PAX_EXTENDED_HEADER_LC, LF_PAX_EXTENDED_HEADER_UC, LF_PAX_GLOBAL_EXTENDED_HEADER, LF_SYMLINK, LONGNAMESLEN_GNU, MAGIC_OFFSET, MAGIC_POSIX, MAGICLEN, MAXID, MAXSIZE, MODELEN, MODTIMELEN, NAMELEN, OFFSETLEN_GNU, PAD2LEN_GNU, PREFIXLEN, PURE_MAGICLEN, REALSIZELEN_GNU, SIZELEN, SPARSELEN_GNU, SPARSELEN_GNU_SPARSE, TMAGIC, UIDLEN, UNAMELEN, VERSION_GNU_SPACE, VERSION_GNU_ZERO, VERSION_OFFSET, VERSION_POSIX, VERSIONLENModifier and TypeFieldDescriptionstatic final intThe length of the access time field in an old GNU header buffer.static final intThe length of the checksum field in a header buffer.static final intThe length of the created time field in an old GNU header buffer.static final intThe length of each of the device fields (major and minor) in a header buffer.static final intGNU format as per before tar 1.12.static final intPure Posix format.static final intThe length of the group id field in a header buffer.static final intThe length of the group name field in a header buffer.static final StringThe name of the GNU tar entry which contains a long name.static final StringThe magic tag representing a GNU tar archive.static final intThe length of the is extension field in an old GNU header buffer.static final intThe length of the is extension field in a sparse header buffer.static final byteBlock device file type.static final byteCharacter device file type.static final byteContiguous file type.static final byteDirectory file type.static final byteFIFO (pipe) file type.static final byteIdentifies the *next* file on the tape as having a long linkname.static final byteIdentifies the *next* file on the tape as having a long name.static final byteSparse file type.static final byteLink file type.static final byteNormal file type.static final byteLF_ constants represent the "link flag" of an entry, or more commonly, the "entry type".static final byteIdentifies the entry as a Pax extended header.static final byteIdentifies the entry as a Pax extended header (SunOS tar -E).static final byteIdentifies the entry as a Pax global extended header.static final byteSymbolic link file type.static final intThe length of the long names field in an old GNU header buffer.static final intOffset of start of magic field within header recordstatic final StringThe magic tag representing a POSIX tar archive.static final intThe length of the magic field in a header buffer including the version.static final longThe maximum value of gid/uid in a tar archive which can be expressed in octal char notation (that's 7 sevens, octal).static final longThe maximum size of a file in a tar archive which can be expressed in octal char notation (that's 11 sevens, octal).static final intThe length of the mode field in a header buffer.static final intThe length of the modification time field in a header buffer.static final intThe length of the name field in a header buffer.static final intThe length of the multivolume start offset field in an old GNU header buffer.static final intThe length of the padding field in an old GNU header buffer.static final intLength of the prefix field.static final intThe length of the magic field in a header buffer.static final intThe length of the real size field in an old GNU header buffer.static final intThe length of the size field in a header buffer.static final intThe sum of the length of all sparse headers in an old GNU header buffer.static final intThe sum of the length of all sparse headers in a sparse header buffer.static final Stringstatic final intThe length of the user id field in a header buffer.static final intThe length of the user name field in a header buffer.static final Stringstatic final Stringstatic final intOffset of start of magic field within header recordstatic final Stringstatic final intPreviously this was regarded as part of "magic" field, but it is separate. -
Constructor Summary
ConstructorsConstructorDescriptionTarArchiveSparseEntry(byte[] headerBuf) Construct an entry from an archive's header bytes. -
Method Summary
-
Constructor Details
-
TarArchiveSparseEntry
Construct an entry from an archive's header bytes. File is set to null.- Parameters:
headerBuf- The header bytes from a tar archive entry.- Throws:
IOException- on unknown format
-
-
Method Details
-
isExtended
public boolean isExtended()
-