Class PathPermissions
java.lang.Object
com.azure.storage.file.datalake.models.PathPermissions
Represents POSIX-style permissions on a given resource. Each resource specifies permissions for the owner, the owning
group, and everyone else. Permissions for users or groups not included here can be set using an Access Control List.
Manipulating resource permissions is only supported when ADLS interop and Hierarchical Namespace are enabled.
-
Constructor Summary
ConstructorsConstructorDescriptionInitializes a new instance ofPathPermissionsby setting each member to a new instance ofRolePermissions. -
Method Summary
Modifier and TypeMethodDescriptionbooleangetGroup()Returns theRolePermissionsfor the owning group of the resource.getOther()Returns theRolePermissionsfor the other users.getOwner()Returns theRolePermissionsfor the owner of the resource.inthashCode()booleanReturns whether there is more permissions information in the ACLs.booleanReturns whether the sticky bit has been set.static PathPermissionsparseOctal(String octal) Converts an octal string into aPathPermissionsobject.static PathPermissionsparseSymbolic(String str) Converts a symbolic representation of the permissions into aPathPermissionsobject.setGroup(RolePermissions group) Sets the permissions for the owning group of the resource.setOther(RolePermissions other) Sets the permissions for the other users of the resource.setOwner(RolePermissions owner) Sets the permissions for the owner of the resource.setStickyBit(boolean hasStickyBit) Sets the value of the sticky bit.toString()Converts this object into its octal representation.
-
Constructor Details
-
PathPermissions
public PathPermissions()Initializes a new instance ofPathPermissionsby setting each member to a new instance ofRolePermissions.
-
-
Method Details
-
equals
-
hashCode
public int hashCode() -
parseOctal
Converts an octal string into aPathPermissionsobject.e.g. 1752 0/1 in the first digit indicates sticky bit. Each subsequent octal character can be expanded into three bits. In order of MSB to LSB, the bits represent read, write, execute.
- Parameters:
octal- The octal representation of the permissions.- Returns:
- The permissions parsed out into a
PathPermissionsinstance. - Throws:
IllegalArgumentException- if the String does not match the format.
-
parseSymbolic
Converts a symbolic representation of the permissions into aPathPermissionsobject.e.g. rwxr-x-wT Each set of three characters correspondes to owner, owning group, and other respectively. 'r', 'w', and 'x' respectively refer to read, write, and execute. A '-' indicates the permission is not given. The sticky bit, if set, takes the place of the last execute bit; a 't' takes the place of 'x' and a 'T' takes the place of '-'.
- Parameters:
str- The symbolic representation of the permissions.- Returns:
- The permissions parsed out into a
PathPermissionsinstance. - Throws:
IllegalArgumentException- if the String does not match the format.
-
toString
Converts this object into its octal representation. -
getOwner
Returns theRolePermissionsfor the owner of the resource.- Returns:
- the
RolePermissionsfor the owner of the resource.
-
getGroup
Returns theRolePermissionsfor the owning group of the resource.- Returns:
- the
RolePermissionsfor the owning group of the resource.
-
getOther
Returns theRolePermissionsfor the other users.- Returns:
- the
RolePermissionsfor the other users.
-
setOwner
Sets the permissions for the owner of the resource.- Parameters:
owner- TheRolePermissionsthat specify what permissions the owner should have.- Returns:
- The updated PathPermissions object.
-
setGroup
Sets the permissions for the owning group of the resource.- Parameters:
group- TheRolePermissionsthat specify what permissions the owning group should have.- Returns:
- The updated PathPermissions object.
-
setOther
Sets the permissions for the other users of the resource.- Parameters:
other- TheRolePermissionsthat specify what permissions other users should have.- Returns:
- The updated PathPermissions object.
-
isStickyBitSet
public boolean isStickyBitSet()Returns whether the sticky bit has been set. The sticky bit may be set on directories, the files in that directory may only be renamed or deleted by the file's owner, the directory's owner, or the root user.- Returns:
trueif the sticky bit is set andfalseotherwise.
-
setStickyBit
Sets the value of the sticky bit. The sticky bit may be set on directories, the files in that directory may only be renamed or deleted by the file's owner, the directory's owner, or the root user.- Parameters:
hasStickyBit-Trueto set the sticky bit andfalseto clear it.- Returns:
- The updated PathPermissions object.
-
isExtendedInfoInAcl
public boolean isExtendedInfoInAcl()Returns whether there is more permissions information in the ACLs. The permissions string only returns information on the owner, owning group, and other, but the ACLs may contain more permissions for specific users or groups.- Returns:
trueif there is more information in the ACL.falseotherwise.
-