Class ExtraFieldUtils.UnparseableExtraField

  • All Implemented Interfaces:
    UnparseableExtraFieldBehavior
    Enclosing class:
    ExtraFieldUtils

    public static final class ExtraFieldUtils.UnparseableExtraField
    extends java.lang.Object
    implements UnparseableExtraFieldBehavior
    "enum" for the possible actions to take if the extra field cannot be parsed.

    This class has been created long before Java 5 and would have been a real enum ever since.

    Since:
    1.1
    • Method Detail

      • getKey

        public int getKey()
        Key of the action to take.
        Returns:
        the key
      • onUnparseableExtraField

        public ZipExtraField onUnparseableExtraField​(byte[] data,
                                                     int off,
                                                     int len,
                                                     boolean local,
                                                     int claimedLength)
                                              throws java.util.zip.ZipException
        Description copied from interface: UnparseableExtraFieldBehavior
        Decides what to do with extra field data that doesn't follow the recommended pattern.
        Specified by:
        onUnparseableExtraField in interface UnparseableExtraFieldBehavior
        Parameters:
        data - the array of extra field data
        off - offset into data where the unparseable data starts
        len - the length of unparseable 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.
        claimedLength - length of the extra field claimed by the third and forth byte if it did follow the recommended pattern
        Returns:
        null if the data should be ignored or an extra field implementation that represents the data
        Throws:
        java.util.zip.ZipException - if an error occurs or unparseable extra fields must not be accepted