Top Description Fields Constructors Methods
org.apache.commons.compress.archivers.zip

public final Class JarMarker

extends Object
implements ZipExtraField
Class Inheritance
All Implemented Interfaces
org.apache.commons.compress.archivers.zip.ZipExtraField
Imports
java.util.zip.ZipException, org.apache.commons.compress.utils.ByteUtils

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

Field Summary

Modifier and TypeField and Description
private static final JarMarker
pack-priv static final ZipShort
private static final ZipShort

Constructor Summary

AccessConstructor and Description
public
JarMarker()

No-arg constructor

Method Summary

Modifier and TypeMethod and Description
public byte[]

Returns:

the data
getCentralDirectoryData
()

Implements org.apache.commons.compress.archivers.zip.ZipExtraField.getCentralDirectoryData.

The actual data to put central directory - without Header-ID or length specifier.
public ZipShort

Returns:

0
getCentralDirectoryLength
()

Implements org.apache.commons.compress.archivers.zip.ZipExtraField.getCentralDirectoryLength.

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

Returns:

the header id
getHeaderId
()

Implements org.apache.commons.compress.archivers.zip.ZipExtraField.getHeaderId.

The Header-ID.
public static JarMarker

Returns:

the DEFAULT jarmaker.
getInstance
()

Since JarMarker is stateless we can always use the same instance.

public byte[]

Returns:

the data
getLocalFileDataData
()

Implements org.apache.commons.compress.archivers.zip.ZipExtraField.getLocalFileDataData.

The actual data to put into local file data - without Header-ID or length specifier.
public ZipShort

Returns:

0
getLocalFileDataLength
()

Implements org.apache.commons.compress.archivers.zip.ZipExtraField.getLocalFileDataLength.

Length of the extra field in the local file data - without Header-ID or length specifier.
public void
parseFromCentralDirectoryData(final byte[]
the buffer to read data from
buffer
,
final int
offset into buffer to read data
offset
,
final int
the length of data
length
)

Implements org.apache.commons.compress.archivers.zip.ZipExtraField.parseFromCentralDirectoryData.

Doesn't do anything special since this class always uses the same data in central directory and local file data.
public void
parseFromLocalFileData(final byte[]
an array of bytes
data
,
final int
the start offset
offset
,
final int
the number of bytes in the array from offset
length
)

Implements org.apache.commons.compress.archivers.zip.ZipExtraField.parseFromLocalFileData.

Populate data from this array as if it was in local file data.
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

DEFAULTback to summary
private static final JarMarker DEFAULT
IDback to summary
pack-priv static final ZipShort ID
NULLback to summary
private static final ZipShort NULL

Constructor Detail

JarMarkerback to summary
public JarMarker()

No-arg constructor

Method Detail

getCentralDirectoryDataback to summary
public byte[] getCentralDirectoryData()

Implements org.apache.commons.compress.archivers.zip.ZipExtraField.getCentralDirectoryData.

The actual data to put central directory - without Header-ID or length specifier.

Returns:byte[]

the data

Annotations
@Override
getCentralDirectoryLengthback to summary
public ZipShort getCentralDirectoryLength()

Implements org.apache.commons.compress.archivers.zip.ZipExtraField.getCentralDirectoryLength.

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

Returns:ZipShort

0

Annotations
@Override
getHeaderIdback to summary
public ZipShort getHeaderId()

Implements org.apache.commons.compress.archivers.zip.ZipExtraField.getHeaderId.

The Header-ID.

Returns:ZipShort

the header id

Annotations
@Override
getInstanceback to summary
public static JarMarker getInstance()

Since JarMarker is stateless we can always use the same instance.

Returns:JarMarker

the DEFAULT jarmaker.

getLocalFileDataDataback to summary
public byte[] getLocalFileDataData()

Implements org.apache.commons.compress.archivers.zip.ZipExtraField.getLocalFileDataData.

The actual data to put into local file data - without Header-ID or length specifier.

Returns:byte[]

the data

Annotations
@Override
getLocalFileDataLengthback to summary
public ZipShort getLocalFileDataLength()

Implements org.apache.commons.compress.archivers.zip.ZipExtraField.getLocalFileDataLength.

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

Returns:ZipShort

0

Annotations
@Override
parseFromCentralDirectoryDataback to summary
public void parseFromCentralDirectoryData(final byte[] buffer, final int offset, final int length) throws ZipException

Implements org.apache.commons.compress.archivers.zip.ZipExtraField.parseFromCentralDirectoryData.

Doesn't do anything special since this class always uses the same data in central directory and local file data.

Parameters
buffer:byte[]

Doc from org.apache.commons.compress.archivers.zip.ZipExtraField.parseFromCentralDirectoryData.

the buffer to read data from

offset:int

Doc from org.apache.commons.compress.archivers.zip.ZipExtraField.parseFromCentralDirectoryData.

offset into buffer to read data

length:int

Doc from org.apache.commons.compress.archivers.zip.ZipExtraField.parseFromCentralDirectoryData.

the length of data

Annotations
@Override
Exceptions
ZipException:

Doc from org.apache.commons.compress.archivers.zip.ZipExtraField.parseFromCentralDirectoryData.

on error

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

Implements org.apache.commons.compress.archivers.zip.ZipExtraField.parseFromLocalFileData.

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

Parameters
data:byte[]

an array of bytes

offset:int

the start offset

length:int

the number of bytes in the array from offset

Annotations
@Override
Exceptions
ZipException:
on error