Interface ExtraFieldParsingBehavior
-
- All Superinterfaces:
UnparseableExtraFieldBehavior
- All Known Implementing Classes:
ZipArchiveEntry.ExtraFieldParsingMode
public interface ExtraFieldParsingBehavior extends UnparseableExtraFieldBehavior
Controls details of parsing ZIP extra fields.- Since:
- 1.19
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description ZipExtraFieldcreateExtraField(ZipShort headerId)Creates an instance of ZipExtraField for the given id.ZipExtraFieldfill(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 Detail
-
createExtraField
ZipExtraField createExtraField(ZipShort headerId) throws java.util.zip.ZipException, java.lang.InstantiationException, java.lang.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:
java.util.zip.ZipException- if an error occursjava.lang.InstantiationException- if unable to instantiate the class, not thrown by Commons Compress.java.lang.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 java.util.zip.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
fieldbut it could be a replacement extra field as well. Must not benull. - Throws:
java.util.zip.ZipException- if an error occurs
-
-