TarArchiveSparseEntry (Apache Ant API)
Description: declaration: package: org.apache.tools.tar, class: TarArchiveSparseEntry

# Class TarArchiveSparseEntry

java.lang.Object
org.apache.tools.tar.TarArchiveSparseEntry

All Implemented Interfaces:
  `TarConstants`

public class TarArchiveSparseEntry extends Object implements 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, VERSIONLEN`
  Modifier and Type
  Field
  Description
  `static final int`
  `ATIMELEN_GNU`
  The length of the access time field in an old GNU header buffer.
  `static final int`
  `CHKSUMLEN`
  The length of the checksum field in a header buffer.
  `static final int`
  `CTIMELEN_GNU`
  The length of the created time field in an old GNU header buffer.
  `static final int`
  `DEVLEN`
  The length of each of the device fields (major and minor) in a header buffer.
  `static final int`
  `FORMAT_OLDGNU`
  GNU format as per before tar 1.12.
  `static final int`
  `FORMAT_POSIX`
  Pure Posix format.
  `static final int`
  `GIDLEN`
  The length of the group id field in a header buffer.
  `static final int`
  `GNAMELEN`
  The length of the group name field in a header buffer.
  `static final String`
  `GNU_LONGLINK`
  The name of the GNU tar entry which contains a long name.
  `static final String`
  `GNU_TMAGIC`
  The magic tag representing a GNU tar archive.
  `static final int`
  `ISEXTENDEDLEN_GNU`
  The length of the is extension field in an old GNU header buffer.
  `static final int`
  `ISEXTENDEDLEN_GNU_SPARSE`
  The length of the is extension field in a sparse header buffer.
  `static final byte`
  `LF_BLK`
  Block device file type.
  `static final byte`
  `LF_CHR`
  Character device file type.
  `static final byte`
  `LF_CONTIG`
  Contiguous file type.
  `static final byte`
  `LF_DIR`
  Directory file type.
  `static final byte`
  `LF_FIFO`
  FIFO (pipe) file type.
  `static final byte`
  `LF_GNUTYPE_LONGLINK`
  Identifies the *next* file on the tape as having a long linkname.
  `static final byte`
  `LF_GNUTYPE_LONGNAME`
  Identifies the *next* file on the tape as having a long name.
  `static final byte`
  `LF_GNUTYPE_SPARSE`
  Sparse file type.
  `static final byte`
  `LF_LINK`
  Link file type.
  `static final byte`
  `LF_NORMAL`
  Normal file type.
  `static final byte`
  `LF_OLDNORM`
  LF_ constants represent the "link flag" of an entry, or more commonly, the "entry type".
  `static final byte`
  `LF_PAX_EXTENDED_HEADER_LC`
  Identifies the entry as a Pax extended header.
  `static final byte`
  `LF_PAX_EXTENDED_HEADER_UC`
  Identifies the entry as a Pax extended header (SunOS tar -E).
  `static final byte`
  `LF_PAX_GLOBAL_EXTENDED_HEADER`
  Identifies the entry as a Pax global extended header.
  `static final byte`
  `LF_SYMLINK`
  Symbolic link file type.
  `static final int`
  `LONGNAMESLEN_GNU`
  The length of the long names field in an old GNU header buffer.
  `static final int`
  `MAGIC_OFFSET`
  Offset of start of magic field within header record
  `static final String`
  `MAGIC_POSIX`
  The magic tag representing a POSIX tar archive.
  `static final int`
  `MAGICLEN`
  The length of the magic field in a header buffer including the version.
  `static final long`
  `MAXID`
  The maximum value of gid/uid in a tar archive which can be expressed in octal char notation (that's 7 sevens, octal).
  `static final long`
  `MAXSIZE`
  The maximum size of a file in a tar archive which can be expressed in octal char notation (that's 11 sevens, octal).
  `static final int`
  `MODELEN`
  The length of the mode field in a header buffer.
  `static final int`
  `MODTIMELEN`
  The length of the modification time field in a header buffer.
  `static final int`
  `NAMELEN`
  The length of the name field in a header buffer.
  `static final int`
  `OFFSETLEN_GNU`
  The length of the multivolume start offset field in an old GNU header buffer.
  `static final int`
  `PAD2LEN_GNU`
  The length of the padding field in an old GNU header buffer.
  `static final int`
  `PREFIXLEN`
  Length of the prefix field.
  `static final int`
  `PURE_MAGICLEN`
  The length of the magic field in a header buffer.
  `static final int`
  `REALSIZELEN_GNU`
  The length of the real size field in an old GNU header buffer.
  `static final int`
  `SIZELEN`
  The length of the size field in a header buffer.
  `static final int`
  `SPARSELEN_GNU`
  The sum of the length of all sparse headers in an old GNU header buffer.
  `static final int`
  `SPARSELEN_GNU_SPARSE`
  The sum of the length of all sparse headers in a sparse header buffer.
  `static final String`
  `TMAGIC`
  `static final int`
  `UIDLEN`
  The length of the user id field in a header buffer.
  `static final int`
  `UNAMELEN`
  The length of the user name field in a header buffer.
  `static final String`
  `VERSION_GNU_SPACE`
  `static final String`
  `VERSION_GNU_ZERO`
  `static final int`
  `VERSION_OFFSET`
  Offset of start of magic field within header record
  `static final String`
  `VERSION_POSIX`
  `static final int`
  `VERSIONLEN`
  Previously this was regarded as part of "magic" field, but it is separate.

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `TarArchiveSparseEntry(byte[] headerBuf)`
  Construct an entry from an archive's header bytes.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `boolean`
  `isExtended()`

  ### Methods inherited from class Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Constructor Details

  - ### TarArchiveSparseEntry

    public TarArchiveSparseEntry(byte[] headerBuf) throws IOException
    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()