Class DefaultAccessControlList

  • All Implemented Interfaces:
    java.io.Serializable

    public class DefaultAccessControlList
    extends AccessControlList
    Default Access control list for a directory.
    See Also:
    Serialized Form
    • Constructor Detail

      • DefaultAccessControlList

        public DefaultAccessControlList()
        Constructor to build a default ACL that is empty.
      • DefaultAccessControlList

        public DefaultAccessControlList​(AccessControlList acl)
        Constructor to build a default ACL based on an access ACL.
        Parameters:
        acl - the access acl
    • Method Detail

      • generateChildFileACL

        public AccessControlList generateChildFileACL​(java.lang.Short umask)
        create a child file 's accessACL based on the default ACL.
        Parameters:
        umask - file's umask
        Returns:
        child file's access ACL
      • generateChildDirACL

        public Pair<AccessControlList,​DefaultAccessControlList> generateChildDirACL​(java.lang.Short umask)
        Creates a child directory's access ACL and default ACL based on the default ACL.
        Parameters:
        umask - child's umask
        Returns:
        child directory's access ACL and default ACL
      • removeEntry

        public void removeEntry​(AclEntry entry)
        Removes the specified entry. A base entry is not allowed to be removed.
        Overrides:
        removeEntry in class AccessControlList
        Parameters:
        entry - the entry to be removed
      • setEntry

        public void setEntry​(AclEntry entry)
        Description copied from class: AccessControlList
        Sets an entry into the access control list. If an entry with the same type and subject already exists, overwrites the existing entry; Otherwise, adds this new entry. After we modify entries for NAMED_GROUP, OWNING_GROUP, NAMED_USER, we need to update the mask.
        Overrides:
        setEntry in class AccessControlList
        Parameters:
        entry - the entry to be added or updated
      • isEmpty

        public boolean isEmpty()
        Returns true if the default ACL is empty.
        Returns:
        true if empty
      • setEmpty

        public void setEmpty​(boolean empty)
        Parameters:
        empty - set the DefaultAccessControlList to empty or not
      • getEntries

        public java.util.List<AclEntry> getEntries()
        Returns a list of AclEntry which represent this ACL instance. The mask will only be included if extended ACL entries exist.
        Overrides:
        getEntries in class AccessControlList
        Returns:
        an immutable list of ACL entries