Enum ZipArchiveEntry.ExtraFieldParsingMode

    • Method Detail

      • values

        public static ZipArchiveEntry.ExtraFieldParsingMode[] values()
        Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
        for (ZipArchiveEntry.ExtraFieldParsingMode c : ZipArchiveEntry.ExtraFieldParsingMode.values())
            System.out.println(c);
        
        Returns:
        an array containing the constants of this enum type, in the order they are declared
      • valueOf

        public static ZipArchiveEntry.ExtraFieldParsingMode valueOf​(java.lang.String name)
        Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
        Parameters:
        name - the name of the enum constant to be returned.
        Returns:
        the enum constant with the specified name
        Throws:
        java.lang.IllegalArgumentException - if this enum type has no constant with the specified name
        java.lang.NullPointerException - if the argument is null
      • 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
      • fill

        public ZipExtraField fill​(ZipExtraField field,
                                  byte[] data,
                                  int off,
                                  int len,
                                  boolean local)
                           throws java.util.zip.ZipException
        Description copied from interface: ExtraFieldParsingBehavior
        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).

        Specified by:
        fill in interface ExtraFieldParsingBehavior
        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