ZipExtraField related methods.
| Modifier and Type | Class and Description |
|---|---|
| public static class | ExtraFieldUtils.UnparseableExtraField
"enum" for the possible actions to take if the extra field cannot be parsed. |
| Modifier and Type | Field and Description |
|---|---|
| pack-priv static final ZipExtraField[] | |
| private static final ConcurrentMap | IMPLEMENTATIONS
Static registry of known extra fields. |
| private static final int |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public static ZipExtraField | Returns: an instance of the appropriate ExtraFieldthe header identifier headerId)Creates an instance of the appropriate ExtraField, falls back to |
| public static ZipExtraField | Returns: an instance of the appropriateZipExtraField or null if the id is not supportedthe header identifier headerId)Creates an instance of the appropriate |
| public static ZipExtraField | Returns: the filled field, will never benullthe extra field instance to fill ze, final byte[] the array of extra field data data, final int offset into data where this field's data starts off, final int the length of this field's data len, final boolean whether the extra field data stems from the local file header. If this is false then the data is part if the central directory header extra
data. local)Fills in the extra field data into the given instance. |
| public static byte[] | Returns: an array of bytesan array of ExtraFields data)Merges the central directory fields of the given ZipExtraFields. |
| public static byte[] | Returns: an array of bytesan array of ExtraFiles data)Merges the local file data fields of the given ZipExtraFields. |
| public static ZipExtraField[] | Returns: an array of ExtraFieldsan array of bytes as it appears in local file data data)Parses the array into ExtraFields and populate them with the given data as local file data, throwing an exception if the data cannot be parsed. |
| public static ZipExtraField[] | Returns: an array of ExtraFieldsan array of bytes data, final boolean whether data originates from the local file data or the central directory local)Parses the array into ExtraFields and populate them with the given data, throwing an exception if the data cannot be parsed. |
| public static ZipExtraField[] | Returns: an array of ExtraFieldsan array of bytes data, final boolean whether data originates from the local file data or the central directory local, final ExtraFieldParsingBehavior controls parsing of extra fields. parsingBehavior)Parses the array into ExtraFields and populate them with the given data. |
| public static ZipExtraField[] | Returns: an array of ExtraFieldsan array of bytes data, final boolean whether data originates from the local file data or the central directory local, final ExtraFieldUtils.what to do if the extra field data cannot be parsed. onUnparseableDataParses the array into ExtraFields and populate them with the given data. |
| public static void | register(final Class<?>
the class to register. clazz)
Deprecated
Use
Registers a ZipExtraField implementation, overriding a matching existing entry.
ZipArchiveInputStream#setExtraFieldSupport instead
to not leak instances between archives and applications.
|
| EMPTY_ZIP_EXTRA_FIELD_ARRAY | back to summary |
|---|---|
| pack-priv static final ZipExtraField[] EMPTY_ZIP_EXTRA_FIELD_ARRAY | |
| IMPLEMENTATIONS | back to summary |
|---|---|
| private static final ConcurrentMap<ZipShort, Supplier<ZipExtraField>> IMPLEMENTATIONS Static registry of known extra fields. | |
| WORD | back to summary |
|---|---|
| private static final int WORD | |
| ExtraFieldUtils | back to summary |
|---|---|
| public ExtraFieldUtils() | |
| createExtraField | back to summary |
|---|---|
| public static ZipExtraField createExtraField(final ZipShort headerId) Creates an instance of the appropriate ExtraField, falls back to
| |
| createExtraFieldNoDefault | back to summary |
|---|---|
| public static ZipExtraField createExtraFieldNoDefault(final ZipShort headerId) Creates an instance of the appropriate
| |
| fillExtraField | back to summary |
|---|---|
| public static ZipExtraField fillExtraField(final ZipExtraField ze, final byte[] data, final int off, final int len, final boolean local) throws ZipException Fills in the extra field data into the given instance.
Calls
| |
| mergeCentralDirectoryData | back to summary |
|---|---|
| public static byte[] mergeCentralDirectoryData(final ZipExtraField[] data) Merges the central directory fields of the given ZipExtraFields.
| |
| mergeLocalFileDataData | back to summary |
|---|---|
| public static byte[] mergeLocalFileDataData(final ZipExtraField[] data) Merges the local file data fields of the given ZipExtraFields.
| |
| parse | back to summary |
|---|---|
| public static ZipExtraField[] parse(final byte[] data) throws ZipException Parses the array into ExtraFields and populate them with the given data as local file data, throwing an exception if the data cannot be parsed.
| |
| parse | back to summary |
|---|---|
| public static ZipExtraField[] parse(final byte[] data, final boolean local) throws ZipException Parses the array into ExtraFields and populate them with the given data, throwing an exception if the data cannot be parsed.
| |
| parse | back to summary |
|---|---|
| public static ZipExtraField[] parse(final byte[] data, final boolean local, final ExtraFieldParsingBehavior parsingBehavior) throws ZipException Parses the array into ExtraFields and populate them with the given data.
| |
| parse | back to summary |
|---|---|
| public static ZipExtraField[] parse(final byte[] data, final boolean local, final ExtraFieldUtils. Parses the array into ExtraFields and populate them with the given data.
| |
| register | back to summary |
|---|---|
| public static void register(final Class<?> clazz)
Deprecated Use Registers a ZipExtraField implementation, overriding a matching existing entry.
The given class must have a no-arg constructor and implement the
| |
This class has been created long before Java 5 and would have been a real enum ever since.
| Modifier and Type | Field and Description |
|---|---|
| private final int | |
| public static final ExtraFieldUtils. | READ
Read the extra field data into an instance of |
| public static final int | READ_KEY
Key for "read" action. |
| public static final ExtraFieldUtils. | SKIP
Skip the extra field entirely and don't make its data available - effectively removing the extra field data. |
| public static final int | SKIP_KEY
Key for "skip" action. |
| public static final ExtraFieldUtils. | THROW
Throw an exception if field cannot be parsed. |
| public static final int | THROW_KEY
Key for "throw an exception" action. |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public int | |
| public ZipExtraField | onUnparseableExtraField(final byte[]
the array of extra field data data, final int offset into data where the unparseable data starts off, final int the length of unparseable data len, final boolean whether the extra field data stems from the local file header. If this is false then the data is part if the central directory
header extra data. local, final int length of the extra field claimed by the third and forth byte if it did follow the recommended pattern claimedLength)Implements org. |
| key | back to summary |
|---|---|
| private final int key | |
| READ | back to summary |
|---|---|
| public static final ExtraFieldUtils. Read the extra field data into an instance of | |
| READ_KEY | back to summary |
|---|---|
| public static final int READ_KEY Key for "read" action. | |
| SKIP | back to summary |
|---|---|
| public static final ExtraFieldUtils. Skip the extra field entirely and don't make its data available - effectively removing the extra field data. | |
| SKIP_KEY | back to summary |
|---|---|
| public static final int SKIP_KEY Key for "skip" action. | |
| THROW | back to summary |
|---|---|
| public static final ExtraFieldUtils. Throw an exception if field cannot be parsed. | |
| THROW_KEY | back to summary |
|---|---|
| public static final int THROW_KEY Key for "throw an exception" action. | |
| UnparseableExtraField | back to summary |
|---|---|
| private UnparseableExtraField(final int k) | |
| getKey | back to summary |
|---|---|
| public int getKey() Key of the action to take.
| |
| onUnparseableExtraField | back to summary |
|---|---|
| public ZipExtraField onUnparseableExtraField(final byte[] data, final int off, final int len, final boolean local, final int claimedLength) throws ZipException Implements org. Doc from org. Decides what to do with extra field data that doesn't follow the recommended pattern.
| |