Class UnrecognizedExtraField
java.lang.Object
org.apache.commons.compress.archivers.zip.UnrecognizedExtraField
- All Implemented Interfaces:
ZipExtraField
Simple placeholder for all those extra fields we don't want to deal with.
Assumes local file data and central directory entries are identical - unless told the opposite.
- This class is not thread-safe
-
Field Summary
Fields inherited from interface org.apache.commons.compress.archivers.zip.ZipExtraField
EXTRAFIELD_HEADER_SIZE
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionbyte[]
Gets the central data.Gets the central data length.Gets the header id.byte[]
Gets the local data.Gets the length of the local data.void
parseFromCentralDirectoryData
(byte[] data, int offset, int length) Populate data from this array as if it was in central directory data.void
parseFromLocalFileData
(byte[] data, int offset, int length) Populate data from this array as if it was in local file data.void
setCentralDirectoryData
(byte[] data) Sets the extra field data in central directory.void
setHeaderId
(ZipShort headerId) Sets the header id.void
setLocalFileDataData
(byte[] data) Sets the extra field data in the local file data - without Header-ID or length specifier.
-
Constructor Details
-
UnrecognizedExtraField
public UnrecognizedExtraField()
-
-
Method Details
-
getCentralDirectoryData
Gets the central data.- Specified by:
getCentralDirectoryData
in interfaceZipExtraField
- Returns:
- the central data if present, else return the local file data
-
getCentralDirectoryLength
Gets the central data length. If there is no central data, get the local file data length.- Specified by:
getCentralDirectoryLength
in interfaceZipExtraField
- Returns:
- the central data length
-
getHeaderId
Gets the header id.- Specified by:
getHeaderId
in interfaceZipExtraField
- Returns:
- the header id
-
getLocalFileDataData
Gets the local data.- Specified by:
getLocalFileDataData
in interfaceZipExtraField
- Returns:
- the local data
-
getLocalFileDataLength
Gets the length of the local data.- Specified by:
getLocalFileDataLength
in interfaceZipExtraField
- Returns:
- the length of the local data
-
parseFromCentralDirectoryData
Description copied from interface:ZipExtraField
Populate data from this array as if it was in central directory data.- Specified by:
parseFromCentralDirectoryData
in interfaceZipExtraField
- Parameters:
data
- the array of bytes.offset
- the source location in the data array.length
- the number of bytes to use in the data array.- See Also:
-
parseFromLocalFileData
Description copied from interface:ZipExtraField
Populate data from this array as if it was in local file data.- Specified by:
parseFromLocalFileData
in interfaceZipExtraField
- Parameters:
data
- the array of bytes.offset
- the source location in the data array.length
- the number of bytes to use in the data array.- See Also:
-
setCentralDirectoryData
Sets the extra field data in central directory.- Parameters:
data
- the data to use
-
setHeaderId
Sets the header id.- Parameters:
headerId
- the header id to use
-
setLocalFileDataData
Sets the extra field data in the local file data - without Header-ID or length specifier.- Parameters:
data
- the field data to use
-