org.apache.commons.compress.archivers.zip

Class AsiExtraField

  • All Implemented Interfaces:
    Cloneable, UnixStat, ZipExtraField


    public class AsiExtraFieldextends Objectimplements ZipExtraField, UnixStat, Cloneable
    Adds Unix file permission and UID/GID fields as well as symbolic link handling.

    This class uses the ASi extra field in the format:

             Value         Size            Description         -----         ----            ----------- (Unix3) 0x756e        Short           tag for this extra block type         TSize         Short           total data size for this block         CRC           Long            CRC-32 of the remaining data         Mode          Short           file permissions         SizDev        Long            symlink'd size OR major/minor dev num         UID           Short           user ID         GID           Short           group ID         (var.)        variable        symbolic link filename 

    taken from appnote.iz (Info-ZIP note, 981119) found at ftp://ftp.uu.net/pub/archiving/zip/doc/

    Short is two bytes and Long is four bytes in big endian byte and word order, device numbers are currently not supported.

    This class is not thread-safe

    Since the documentation this class is based upon doesn't mention the character encoding of the file name at all, it is assumed that it uses the current platform's default encoding.

    • Constructor Detail

      • AsiExtraField

        public AsiExtraField()
        Constructor for AsiExtraField.
    • Method Detail

      • setUserId

        public void setUserId(int uid)
        Set the user id.
        Parameters:
        uid - the user id
      • getUserId

        public int getUserId()
        Get the user id.
        Returns:
        the user id
      • setGroupId

        public void setGroupId(int gid)
        Set the group id.
        Parameters:
        gid - the group id
      • getGroupId

        public int getGroupId()
        Get the group id.
        Returns:
        the group id
      • setLinkedFile

        public void setLinkedFile(String name)
        Indicate that this entry is a symbolic link to the given filename.
        Parameters:
        name - Name of the file this entry links to, empty String if it is not a symbolic link.
      • getLinkedFile

        public String getLinkedFile()
        Name of linked file
        Returns:
        name of the file this entry links to if it is a symbolic link, the empty string otherwise.
      • isLink

        public boolean isLink()
        Is this entry a symbolic link?
        Returns:
        true if this is a symbolic link
      • setMode

        public void setMode(int mode)
        File mode of this file.
        Parameters:
        mode - the file mode
      • getMode

        public int getMode()
        File mode of this file.
        Returns:
        the file mode
      • setDirectory

        public void setDirectory(boolean dirFlag)
        Indicate whether this entry is a directory.
        Parameters:
        dirFlag - if true, this entry is a directory
      • isDirectory

        public boolean isDirectory()
        Is this entry a directory?
        Returns:
        true if this entry is a directory
      • getMode

        protected int getMode(int mode)
        Get the file mode for given permissions with the correct file type.
        Parameters:
        mode - the mode
        Returns:
        the type with the mode

Copyright © 2016 The Apache Software Foundation. All rights reserved.



NOTHING
NOTHING
Add the Maven Dependecy to your project: maven dependecy for com.amazonaws : aws-java-sdk : 1.3.14