Interface ExtraFieldParsingBehavior
- All Superinterfaces:
UnparseableExtraFieldBehavior
- All Known Implementing Classes:
ZipArchiveEntry.ExtraFieldParsingMode
Controls details of parsing ZIP extra fields.
- Since:
- 1.19
-
Method Summary
Modifier and TypeMethodDescriptioncreateExtraField
(ZipShort headerId) Creates an instance of ZipExtraField for the given id.fill
(ZipExtraField field, byte[] data, int off, int len, boolean local) Fills in the extra field data for a single extra field.Methods inherited from interface org.apache.commons.compress.archivers.zip.UnparseableExtraFieldBehavior
onUnparseableExtraField
-
Method Details
-
createExtraField
ZipExtraField createExtraField(ZipShort headerId) throws ZipException, InstantiationException, IllegalAccessException Creates an instance of ZipExtraField for the given id.A good default implementation would be
ExtraFieldUtils.createExtraField(org.apache.commons.compress.archivers.zip.ZipShort)
.- Parameters:
headerId
- the id for the extra field- Returns:
- an instance of ZipExtraField, must not be
null
- Throws:
ZipException
- if an error occursInstantiationException
- if unable to instantiate the class, not thrown by Commons Compress.IllegalAccessException
- if not allowed to instantiate the class, not thrown by Commons Compress.
-
fill
ZipExtraField fill(ZipExtraField field, byte[] data, int off, int len, boolean local) throws ZipException Fills in the extra field data for a single extra field.A good default implementation would be
ExtraFieldUtils.fillExtraField(org.apache.commons.compress.archivers.zip.ZipExtraField, byte[], int, int, boolean)
.- Parameters:
field
- the extra field instance to filldata
- the array of extra field dataoff
- offset into data where this field's data startslen
- the length of this field's datalocal
- 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.- Returns:
- the filled field. Usually this is the same as
field
but it could be a replacement extra field as well. Must not benull
. - Throws:
ZipException
- if an error occurs
-