org.apache.commons.compress.archivers.zip
Interface ZipExtraField

All Known Implementing Classes:
AbstractUnicodeExtraField, AsiExtraField, JarMarker, UnicodeCommentExtraField, UnicodePathExtraField, UnparseableExtraFieldData, UnrecognizedExtraField, Zip64ExtendedInformationExtraField

public interface ZipExtraField

General format of extra field data.

Extra fields usually appear twice per file, once in the local file data and once in the central directory. Usually they are the same, but they don't have to be. java.util.zip.ZipOutputStream will only use the local file data in both places.


Method Summary
 byte[] getCentralDirectoryData()
          The actual data to put into central directory - without Header-ID or length specifier.
 ZipShort getCentralDirectoryLength()
          Length of the extra field in the central directory - without Header-ID or length specifier.
 ZipShort getHeaderId()
          The Header-ID.
 byte[] getLocalFileDataData()
          The actual data to put into local file data - without Header-ID or length specifier.
 ZipShort getLocalFileDataLength()
          Length of the extra field in the local file data - without Header-ID or length specifier.
 void parseFromCentralDirectoryData(byte[] buffer, int offset, int length)
          Populate data from this array as if it was in central directory data.
 void parseFromLocalFileData(byte[] buffer, int offset, int length)
          Populate data from this array as if it was in local file data.
 

Method Detail

getHeaderId

ZipShort getHeaderId()
The Header-ID.

Returns:
The HeaderId value

getLocalFileDataLength

ZipShort getLocalFileDataLength()
Length of the extra field in the local file data - without Header-ID or length specifier.

Returns:
The LocalFileDataLength value

getCentralDirectoryLength

ZipShort getCentralDirectoryLength()
Length of the extra field in the central directory - without Header-ID or length specifier.

Returns:
The CentralDirectoryLength value

getLocalFileDataData

byte[] getLocalFileDataData()
The actual data to put into local file data - without Header-ID or length specifier.

Returns:
The LocalFileDataData value

getCentralDirectoryData

byte[] getCentralDirectoryData()
The actual data to put into central directory - without Header-ID or length specifier.

Returns:
The CentralDirectoryData value

parseFromLocalFileData

void parseFromLocalFileData(byte[] buffer,
                            int offset,
                            int length)
                            throws ZipException
Populate data from this array as if it was in local file data.

Parameters:
buffer - the buffer to read data from
offset - offset into buffer to read data
length - the length of data
Throws:
ZipException - on error

parseFromCentralDirectoryData

void parseFromCentralDirectoryData(byte[] buffer,
                                   int offset,
                                   int length)
                                   throws ZipException
Populate data from this array as if it was in central directory data.

Parameters:
buffer - the buffer to read data from
offset - offset into buffer to read data
length - the length of data
Throws:
ZipException - on error


Copyright © 2011 The Apache Software Foundation. All Rights Reserved.