org.apache.tools.zip

Class JarMarker

public final class JarMarker extends Object implements ZipExtraField

If this extra field is added as the very first extra field of the archive, Solaris will consider it an executable jar file.

Since: Ant 1.6.3

Constructor Summary
JarMarker()
No-arg constructor
Method Summary
byte[]getCentralDirectoryData()
The actual data to put central directory - without Header-ID or length specifier.
ZipShortgetCentralDirectoryLength()
Length of the extra field in the central directory - without Header-ID or length specifier.
ZipShortgetHeaderId()
The Header-ID.
static JarMarkergetInstance()
Since JarMarker is stateless we can always use the same instance.
byte[]getLocalFileDataData()
The actual data to put into local file data - without Header-ID or length specifier.
ZipShortgetLocalFileDataLength()
Length of the extra field in the local file data - without Header-ID or length specifier.
voidparseFromLocalFileData(byte[] data, int offset, int length)
Populate data from this array as if it was in local file data.

Constructor Detail

JarMarker

public JarMarker()
No-arg constructor

Method Detail

getCentralDirectoryData

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

Returns: the data

getCentralDirectoryLength

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

Returns: 0

getHeaderId

public ZipShort getHeaderId()
The Header-ID.

Returns: the header id

getInstance

public static JarMarker getInstance()
Since JarMarker is stateless we can always use the same instance.

Returns: the DEFAULT jarmaker.

getLocalFileDataData

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

Returns: the data

Since: 1.1

getLocalFileDataLength

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

Returns: 0

parseFromLocalFileData

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

Parameters: data an array of bytes offset the start offset length the number of bytes in the array from offset

Throws: ZipException on error