org.apache.tools.zipClass JarMarker
- java.lang.Object
- org.apache.tools.zip.JarMarker
- All Implemented Interfaces:
- ZipExtraField
public final class JarMarker extends java.lang.Object implements ZipExtraFieldIf 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
Constructors Constructor and Description JarMarker()
No-arg constructor
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method and Description byte[]
getCentralDirectoryData()
The actual data to put 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.static JarMarker
getInstance()
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.ZipShort
getLocalFileDataLength()
Length of the extra field in the local file data - without Header-ID or length specifier.void
parseFromLocalFileData(byte[] data, int offset, int length)
Populate data from this array as if it was in local file data.
Method Detail
getInstance
public static JarMarker getInstance()Since JarMarker is stateless we can always use the same instance.
- Returns:
- the DEFAULT jarmaker.
getHeaderId
public ZipShort getHeaderId()The Header-ID.
- Specified by:
getHeaderId
in interfaceZipExtraField
- Returns:
- the header id
getLocalFileDataLength
public ZipShort getLocalFileDataLength()Length of the extra field in the local file data - without Header-ID or length specifier.
- Specified by:
getLocalFileDataLength
in interfaceZipExtraField
- Returns:
- 0
getCentralDirectoryLength
public ZipShort getCentralDirectoryLength()Length of the extra field in the central directory - without Header-ID or length specifier.
- Specified by:
getCentralDirectoryLength
in interfaceZipExtraField
- Returns:
- 0
getLocalFileDataData
public byte[] getLocalFileDataData()The actual data to put into local file data - without Header-ID or length specifier.
- Specified by:
getLocalFileDataData
in interfaceZipExtraField
- Returns:
- the data
- Since:
- 1.1
getCentralDirectoryData
public byte[] getCentralDirectoryData()The actual data to put central directory - without Header-ID or length specifier.
- Specified by:
getCentralDirectoryData
in interfaceZipExtraField
- Returns:
- the data
parseFromLocalFileData
public void parseFromLocalFileData(byte[] data, int offset, int length) throws java.util.zip.ZipExceptionPopulate data from this array as if it was in local file data.
- Specified by:
parseFromLocalFileData
in interfaceZipExtraField
- Parameters:
data
- an array of bytesoffset
- the start offsetlength
- the number of bytes in the array from offset- Throws:
java.util.zip.ZipException
- on error