Class RolePermissions
- java.lang.Object
-
- com.azure.storage.file.datalake.models.RolePermissions
-
public class RolePermissions extends Object
Represents the POSIX-style permissions on given resource for an arbitrary role. Each role can have any combination of read, write, and execute permissions. Manipulating resource permissions is only supported when ADLS interop and Hierarchical Namespace are enabled.
-
-
Constructor Summary
Constructors Constructor Description RolePermissions()
Initializes an instance ofRolePermissions
with all values set to false.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(Object o)
boolean
hasExecutePermission()
int
hashCode()
boolean
hasReadPermission()
boolean
hasWritePermission()
static RolePermissions
parseOctal(int octal)
Convert an octal representation of permissions for a given role into anRolePermissions
instance.static RolePermissions
parseSymbolic(String str, boolean allowStickyBit)
Convert a symbolic representation of permissions for a given role into anRolePermissions
instance.RolePermissions
setExecutePermission(boolean hasExecutePermission)
Sets the execute permission status.RolePermissions
setReadPermission(boolean hasReadPermission)
Sets the read permission status.RolePermissions
setWritePermission(boolean hasWritePermission)
Sets the write permission status.String
toOctal()
Converts theRolePermissions
instance into its octal representation.String
toSymbolic()
Converts theRolePermissions
instance into its symbolic representation.
-
-
-
Method Detail
-
parseOctal
public static RolePermissions parseOctal(int octal)
Convert an octal representation of permissions for a given role into anRolePermissions
instance.- Parameters:
octal
- The octal digit representing the permissions for the given role.- Returns:
- An
RolePermissions
instance with appropriate fields set.
-
parseSymbolic
public static RolePermissions parseSymbolic(String str, boolean allowStickyBit)
Convert a symbolic representation of permissions for a given role into anRolePermissions
instance.- Parameters:
str
- The string representing the permissions for the given role.allowStickyBit
- Indicates whether the parsing should tolerate the sticky bit. The sticky bit is only valid as the last character of permissions for "other" in aString
representing full permissions for a resource.- Returns:
- An
RolePermissions
instance with appropriate fields set. - Throws:
IllegalArgumentException
- if the String does not match the format.
-
toOctal
public String toOctal()
Converts theRolePermissions
instance into its octal representation.- Returns:
- The
String
representation of the permissions.
-
toSymbolic
public String toSymbolic()
Converts theRolePermissions
instance into its symbolic representation.- Returns:
- The
String
representation of the permission.
-
hasReadPermission
public boolean hasReadPermission()
- Returns:
- the read permission status
-
hasWritePermission
public boolean hasWritePermission()
- Returns:
- the write permission status
-
hasExecutePermission
public boolean hasExecutePermission()
- Returns:
- the execute permission status
-
setReadPermission
public RolePermissions setReadPermission(boolean hasReadPermission)
Sets the read permission status.- Parameters:
hasReadPermission
- Permission status to set- Returns:
- the updated RolePermissions object
-
setWritePermission
public RolePermissions setWritePermission(boolean hasWritePermission)
Sets the write permission status.- Parameters:
hasWritePermission
- Permission status to set- Returns:
- the updated RolePermissions object
-
setExecutePermission
public RolePermissions setExecutePermission(boolean hasExecutePermission)
Sets the execute permission status.- Parameters:
hasExecutePermission
- Permission status to set- Returns:
- the updated RolePermissions object
-
-