Interface ExtraFieldParsingBehavior

    • 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 occurs
        java.lang.InstantiationException - if unable to instantiate the class
        java.lang.IllegalAccessException - if not allowed to instantiate the class
      • 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 fill
        data - the array of extra field data
        off - offset into data where this field's data starts
        len - the length of this field's data
        local - 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 be null.
        Throws:
        java.util.zip.ZipException - if an error occurs