Class RolePermissions
java.lang.Object
com.azure.storage.file.datalake.models.RolePermissions
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
ConstructorsConstructorDescriptionInitializes an instance ofRolePermissionswith all values set to false. -
Method Summary
Modifier and TypeMethodDescriptionbooleanbooleanGets the execute permission status.inthashCode()booleanGets the read permission status.booleanGets the write permission status.static RolePermissionsparseOctal(int octal) Convert an octal representation of permissions for a given role into anRolePermissionsinstance.static RolePermissionsparseSymbolic(String str, boolean allowStickyBit) Convert a symbolic representation of permissions for a given role into anRolePermissionsinstance.setExecutePermission(boolean hasExecutePermission) Sets the execute permission status.setReadPermission(boolean hasReadPermission) Sets the read permission status.setWritePermission(boolean hasWritePermission) Sets the write permission status.toOctal()Converts theRolePermissionsinstance into its octal representation.Converts theRolePermissionsinstance into its symbolic representation.
-
Constructor Details
-
RolePermissions
public RolePermissions()Initializes an instance ofRolePermissionswith all values set to false.
-
-
Method Details
-
parseOctal
Convert an octal representation of permissions for a given role into anRolePermissionsinstance.- Parameters:
octal- The octal digit representing the permissions for the given role.- Returns:
- An
RolePermissionsinstance with appropriate fields set.
-
parseSymbolic
Convert a symbolic representation of permissions for a given role into anRolePermissionsinstance.- 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 aStringrepresenting full permissions for a resource.- Returns:
- An
RolePermissionsinstance with appropriate fields set. - Throws:
IllegalArgumentException- if the String does not match the format.
-
toOctal
Converts theRolePermissionsinstance into its octal representation.- Returns:
- The
Stringrepresentation of the permissions.
-
toSymbolic
Converts theRolePermissionsinstance into its symbolic representation.- Returns:
- The
Stringrepresentation of the permission.
-
equals
-
hashCode
public int hashCode() -
hasReadPermission
public boolean hasReadPermission()Gets the read permission status.- Returns:
- the read permission status
-
hasWritePermission
public boolean hasWritePermission()Gets the write permission status.- Returns:
- the write permission status
-
hasExecutePermission
public boolean hasExecutePermission()Gets the execute permission status.- Returns:
- the execute permission status
-
setReadPermission
Sets the read permission status.- Parameters:
hasReadPermission- Permission status to set- Returns:
- the updated RolePermissions object
-
setWritePermission
Sets the write permission status.- Parameters:
hasWritePermission- Permission status to set- Returns:
- the updated RolePermissions object
-
setExecutePermission
Sets the execute permission status.- Parameters:
hasExecutePermission- Permission status to set- Returns:
- the updated RolePermissions object
-