Class X7875_NewUnix
java.lang.Object
org.apache.commons.compress.archivers.zip.X7875_NewUnix
- All Implemented Interfaces:
- Serializable,- Cloneable,- ZipExtraField
An extra field that stores Unix UID/GID data (owner & group ownership) for a given ZIP entry. We're using the field definition given in Info-Zip's source
 archive: zip-3.0.tar.gz/proginfo/extrafld.txt
 
 Local-header version:
 Value         Size        Description
 -----         ----        -----------
 0x7875        Short       tag for this extra block type ("ux")
 TSize         Short       total data size for this block
 Version       1 byte      version of this extra field, currently 1
 UIDSize       1 byte      Size of UID field
 UID           Variable    UID for this entry (little-endian)
 GIDSize       1 byte      Size of GID field
 GID           Variable    GID for this entry (little-endian)
 Central-header version:
 Value         Size        Description
 -----         ----        -----------
 0x7855        Short       tag for this extra block type ("Ux")
 TSize         Short       total data size for this block (0)
 - Since:
- 1.5
- See Also:
- 
Field SummaryFields inherited from interface org.apache.commons.compress.archivers.zip.ZipExtraFieldEXTRAFIELD_HEADER_SIZE
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionclone()booleanbyte[]The actual data to put into central directory data - without Header-ID or length specifier.Length of the extra field in the central directory data - without Header-ID or length specifier.longgetGID()Gets the GID as a long.The Header-ID.byte[]The actual data to put into local file data - without Header-ID or length specifier.Length of the extra field in the local file data - without Header-ID or length specifier.longgetUID()Gets the UID as a long.inthashCode()voidparseFromCentralDirectoryData(byte[] buffer, int offset, int length) Doesn't do anything since this class doesn't store anything inside the central directory.voidparseFromLocalFileData(byte[] data, int offset, int length) Populate data from this array as if it was in local file data.voidsetGID(long l) Sets the GID.voidsetUID(long l) Sets the UID.toString()Returns a String representation of this class useful for debugging purposes.
- 
Constructor Details- 
X7875_NewUnixpublic X7875_NewUnix()Constructor for X7875_NewUnix.
 
- 
- 
Method Details- 
clone- Overrides:
- clonein class- Object
- Throws:
- CloneNotSupportedException
 
- 
equals
- 
getCentralDirectoryDataThe actual data to put into central directory data - without Header-ID or length specifier.- Specified by:
- getCentralDirectoryDatain interface- ZipExtraField
- Returns:
- get the data
 
- 
getCentralDirectoryLengthLength of the extra field in the central directory data - without Header-ID or length specifier.- Specified by:
- getCentralDirectoryLengthin interface- ZipExtraField
- Returns:
- a ZipShortfor the length of the data of this extra field
 
- 
getGIDGets the GID as a long. GID is typically a 32 bit unsigned value on most Unix systems, so we return a long to avoid integer overflow into the negatives in case values above and including 2^31 are being used.- Returns:
- the GID value.
 
- 
getHeaderIdThe Header-ID.- Specified by:
- getHeaderIdin interface- ZipExtraField
- Returns:
- the value for the header id for this extrafield
 
- 
getLocalFileDataDataThe actual data to put into local file data - without Header-ID or length specifier.- Specified by:
- getLocalFileDataDatain interface- ZipExtraField
- Returns:
- get the data
 
- 
getLocalFileDataLengthLength of the extra field in the local file data - without Header-ID or length specifier.- Specified by:
- getLocalFileDataLengthin interface- ZipExtraField
- Returns:
- a ZipShortfor the length of the data of this extra field
 
- 
getUIDGets the UID as a long. UID is typically a 32 bit unsigned value on most Unix systems, so we return a long to avoid integer overflow into the negatives in case values above and including 2^31 are being used.- Returns:
- the UID value.
 
- 
hashCode
- 
parseFromCentralDirectoryDatapublic void parseFromCentralDirectoryData(byte[] buffer, int offset, int length) throws ZipException Doesn't do anything since this class doesn't store anything inside the central directory.- Specified by:
- parseFromCentralDirectoryDatain interface- ZipExtraField
- Parameters:
- buffer- the buffer to read data from
- offset- offset into buffer to read data
- length- the length of data
- Throws:
- ZipException- on error
 
- 
parseFromLocalFileDataPopulate data from this array as if it was in local file data.- Specified by:
- parseFromLocalFileDatain interface- ZipExtraField
- Parameters:
- data- an array of bytes
- offset- the start offset
- length- the number of bytes in the array from offset
- Throws:
- ZipException- on error
 
- 
setGIDSets the GID.- Parameters:
- l- GID value to set on this extra field.
 
- 
setUIDSets the UID.- Parameters:
- l- UID value to set on this extra field.
 
- 
toStringReturns a String representation of this class useful for debugging purposes.
 
-