Top Description Fields Constructors Methods
org.apache.tools.zip

public Class UnrecognizedExtraField

extends Object
implements CentralDirectoryParsingZipExtraField
Class Inheritance
All Implemented Interfaces
org.apache.tools.zip.CentralDirectoryParsingZipExtraField, org.apache.tools.zip.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.

Field Summary

Modifier and TypeField and Description
private byte[]
centralData

Extra field data in central directory - without Header-ID or length specifier.

private ZipShort
headerId

The Header-ID.

private byte[]
localData

Extra field data in local file data - without Header-ID or length specifier.

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public byte[]

Returns:

the central data if present, else return the local file data
getCentralDirectoryData
()

Implements org.apache.tools.zip.ZipExtraField.getCentralDirectoryData.

Get the central data.
public ZipShort

Returns:

the central data length
getCentralDirectoryLength
()

Implements org.apache.tools.zip.ZipExtraField.getCentralDirectoryLength.

Get the central data length.
public ZipShort

Returns:

the header id
getHeaderId
()

Implements org.apache.tools.zip.ZipExtraField.getHeaderId.

Get the header id.
public byte[]

Returns:

the local data
getLocalFileDataData
()

Implements org.apache.tools.zip.ZipExtraField.getLocalFileDataData.

Get the local data.
public ZipShort

Returns:

the length of the local data
getLocalFileDataLength
()

Implements org.apache.tools.zip.ZipExtraField.getLocalFileDataLength.

Get the length of the local data.
public void
parseFromCentralDirectoryData(byte[]
the array of bytes.
data
,
int
the source location in the data array.
offset
,
int
the number of bytes to use in the data array.
length
)

Implements org.apache.tools.zip.CentralDirectoryParsingZipExtraField.parseFromCentralDirectoryData.

Populate data from this array as if it was in central directory data.
public void
parseFromLocalFileData(byte[]
the array of bytes.
data
,
int
the source location in the data array.
offset
,
int
the number of bytes to use in the data array.
length
)

Implements org.apache.tools.zip.ZipExtraField.parseFromLocalFileData.

Populate data from this array as if it was in local file data.
public void
setCentralDirectoryData(byte[]
the data to use
data
)

Set the extra field data in central directory.

public void
setHeaderId(ZipShort
the header id to use
headerId
)

Set the header id.

public void
setLocalFileDataData(byte[]
the field data to use
data
)

Set the extra field data in the local file data - without Header-ID or length specifier.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

centralDataback to summary
private byte[] centralData

Extra field data in central directory - without Header-ID or length specifier.

Since
1.1
headerIdback to summary
private ZipShort headerId

The Header-ID.

Since
1.1
localDataback to summary
private byte[] localData

Extra field data in local file data - without Header-ID or length specifier.

Since
1.1

Constructor Detail

UnrecognizedExtraFieldback to summary
public UnrecognizedExtraField()

Method Detail

getCentralDirectoryDataback to summary
public byte[] getCentralDirectoryData()

Implements org.apache.tools.zip.ZipExtraField.getCentralDirectoryData.

Get the central data.

Returns:byte[]

the central data if present, else return the local file data

getCentralDirectoryLengthback to summary
public ZipShort getCentralDirectoryLength()

Implements org.apache.tools.zip.ZipExtraField.getCentralDirectoryLength.

Get the central data length. If there is no central data, get the local file data length.

Returns:ZipShort

the central data length

getHeaderIdback to summary
public ZipShort getHeaderId()

Implements org.apache.tools.zip.ZipExtraField.getHeaderId.

Get the header id.

Returns:ZipShort

the header id

getLocalFileDataDataback to summary
public byte[] getLocalFileDataData()

Implements org.apache.tools.zip.ZipExtraField.getLocalFileDataData.

Get the local data.

Returns:byte[]

the local data

getLocalFileDataLengthback to summary
public ZipShort getLocalFileDataLength()

Implements org.apache.tools.zip.ZipExtraField.getLocalFileDataLength.

Get the length of the local data.

Returns:ZipShort

the length of the local data

parseFromCentralDirectoryDataback to summary
public void parseFromCentralDirectoryData(byte[] data, int offset, int length)

Implements org.apache.tools.zip.CentralDirectoryParsingZipExtraField.parseFromCentralDirectoryData.

Doc from org.apache.tools.zip.CentralDirectoryParsingZipExtraField.parseFromCentralDirectoryData.

Populate data from this array as if it was in central directory data.

Parameters
data:byte[]

the array of bytes.

offset:int

the source location in the data array.

length:int

the number of bytes to use in the data array.

parseFromLocalFileDataback to summary
public void parseFromLocalFileData(byte[] data, int offset, int length)

Implements org.apache.tools.zip.ZipExtraField.parseFromLocalFileData.

Doc from org.apache.tools.zip.ZipExtraField.parseFromLocalFileData.

Populate data from this array as if it was in local file data.

Parameters
data:byte[]

the array of bytes.

offset:int

the source location in the data array.

length:int

the number of bytes to use in the data array.

See Also
ZipExtraField#parseFromLocalFileData(byte[], int, int)
setCentralDirectoryDataback to summary
public void setCentralDirectoryData(byte[] data)

Set the extra field data in central directory.

Parameters
data:byte[]

the data to use

setHeaderIdback to summary
public void setHeaderId(ZipShort headerId)

Set the header id.

Parameters
headerId:ZipShort

the header id to use

setLocalFileDataDataback to summary
public void setLocalFileDataData(byte[] data)

Set the extra field data in the local file data - without Header-ID or length specifier.

Parameters
data:byte[]

the field data to use