Class JarMarker
java.lang.Object
org.apache.commons.compress.archivers.zip.JarMarker
- All Implemented Interfaces:
ZipExtraField
If this extra field is added as the very first extra field of the archive, Solaris will consider it an executable jar file.
- This class is immutable
-
Field Summary
Fields inherited from interface org.apache.commons.compress.archivers.zip.ZipExtraField
EXTRAFIELD_HEADER_SIZE
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionbyte[]
The actual data to put central directory - without Header-ID or length specifier.Length of the extra field in the central directory - without Header-ID or length specifier.The Header-ID.static JarMarker
Since JarMarker is stateless we can always use the same instance.byte[]
The actual data to put into local file data - without Header-ID or length specifier.Length of the extra field in the local file data - without Header-ID or length specifier.void
parseFromCentralDirectoryData
(byte[] buffer, int offset, int length) Doesn't do anything special since this class always uses the same data in central directory and local file data.void
parseFromLocalFileData
(byte[] data, int offset, int length) Populate data from this array as if it was in local file data.
-
Constructor Details
-
JarMarker
public JarMarker()No-arg constructor
-
-
Method Details
-
getInstance
Since JarMarker is stateless we can always use the same instance.- Returns:
- the DEFAULT jarmaker.
-
getCentralDirectoryData
The actual data to put central directory - without Header-ID or length specifier.- Specified by:
getCentralDirectoryData
in interfaceZipExtraField
- Returns:
- the data
-
getCentralDirectoryLength
Length of the extra field in the central directory - without Header-ID or length specifier.- Specified by:
getCentralDirectoryLength
in interfaceZipExtraField
- Returns:
- 0
-
getHeaderId
The Header-ID.- Specified by:
getHeaderId
in interfaceZipExtraField
- Returns:
- the header id
-
getLocalFileDataData
The actual data to put into local file data - without Header-ID or length specifier.- Specified by:
getLocalFileDataData
in interfaceZipExtraField
- Returns:
- the data
-
getLocalFileDataLength
Length of the extra field in the local file data - without Header-ID or length specifier.- Specified by:
getLocalFileDataLength
in interfaceZipExtraField
- Returns:
- 0
-
parseFromCentralDirectoryData
public void parseFromCentralDirectoryData(byte[] buffer, int offset, int length) throws ZipException Doesn't do anything special since this class always uses the same data in central directory and local file data.- Specified by:
parseFromCentralDirectoryData
in interfaceZipExtraField
- Parameters:
buffer
- the buffer to read data fromoffset
- offset into buffer to read datalength
- the length of data- Throws:
ZipException
- on error
-
parseFromLocalFileData
Populate 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:
ZipException
- on error
-