Class AclEntry

  • All Implemented Interfaces:
    java.io.Serializable

    public final class AclEntry
    extends java.lang.Object
    implements java.io.Serializable
    An entry in AccessControlList.
    See Also:
    Serialized Form
    • Method Detail

      • getSubject

        public java.lang.String getSubject()
        Returns:
        the subject
      • getActions

        public AclActions getActions()
        Returns:
        a copy of actions
      • isDefault

        public boolean isDefault()
        Returns:
        whether the action applies to default ACL
      • setDefault

        public void setDefault​(boolean defaultEntry)
        Sets the entry to be default.
        Parameters:
        defaultEntry - indicating default or not
      • equals

        public boolean equals​(java.lang.Object o)
        Overrides:
        equals in class java.lang.Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • toCliString

        public java.lang.String toCliString()
        Returns:
        the string representation for the CLI
      • toDefault

        public static java.lang.String toDefault​(java.lang.String stringEntry)
        Convert a normal ACL to a string representing a default ACL.
        Parameters:
        stringEntry - normal ACL, if it is already default ACL, then return the default ACL
        Returns:
        a default ACL
      • fromCliString

        public static AclEntry fromCliString​(java.lang.String stringEntry)
        Creates an AclEntry from a string. The possible string inputs are: Owning User: user::[rwx] Named User: user:[user name]:[rwx] Owning Group: group::[rwx] Named Group: group:[group name]:[rwx] Mask: mask::[rwx] Other: other::[rwx] all the above entries, but with default:added to the beginning of the entry default:user::[rwx] [rwx]: all combinations are possible ('---' to 'rwx')
        Parameters:
        stringEntry - the CLI string representation
        Returns:
        the AclEntry instance created from the CLI string representation
      • fromCliStringWithoutPermissions

        public static AclEntry fromCliStringWithoutPermissions​(java.lang.String stringEntry)
        Creates an AclEntry from a string without permissions. The possible string inputs are: Named User: user:USER_NAME[:] Named Group: group:GROUP_NAME[:] Mask: mask[:][:] Default versions of Named User: default:user:USER_NAME[:] Default versions of Named Group: default:group:GROUP_NAME[:] Default version of the mask: default: mask[:][:]
        Parameters:
        stringEntry - the CLI string representation, without permissions
        Returns:
        the AclEntry instance created from the CLI string representation