Class PathSasPermission
java.lang.Object
com.azure.storage.file.datalake.sas.PathSasPermission
This is a helper class to construct a string representing the permissions granted by a ServiceSAS to a path. Setting
a value to true means that any SAS which uses these permissions will grant permissions for that operation. It is
possible to construct the permissions string without this class, but the order of the permissions is particular and
this class guarantees correctness.
-
Constructor Summary
ConstructorsConstructorDescriptionInitializes aPathSasPermission
object with all fields set to false. -
Method Summary
Modifier and TypeMethodDescriptionboolean
Gets the add permission status.boolean
Gets the create permission status.boolean
Gets the delete permission status.boolean
Gets the execute permission status.boolean
Gets the list permission status.boolean
Gets the manage access control permission status.boolean
Gets the manage ownership permission status.boolean
Gets the move permission status.boolean
Gets the read permission status.boolean
Gets the write permission status.static PathSasPermission
Creates aPathSasPermission
from the specified permissions string.setAddPermission
(boolean hasAddPermission) Sets the add permission status.setCreatePermission
(boolean hasCreatePermission) Sets the create permission status.setDeletePermission
(boolean hasDeletePermission) Sets the delete permission status.setExecutePermission
(boolean hasExecutePermission) Sets the execute permission status.setListPermission
(boolean hasListPermission) Sets the list permission status.setManageAccessControlPermission
(boolean hasManageAccessControlPermission) Sets the manage access control permission status.setManageOwnershipPermission
(boolean hasManageOwnershipPermission) Sets the manage ownership permission status.setMovePermission
(boolean hasMovePermission) Sets the move permission status.setReadPermission
(boolean hasReadPermission) Sets the read permission status.setWritePermission
(boolean hasWritePermission) Sets the write permission status.toString()
Converts the given permissions to aString
.
-
Constructor Details
-
PathSasPermission
public PathSasPermission()Initializes aPathSasPermission
object with all fields set to false.
-
-
Method Details
-
parse
Creates aPathSasPermission
from the specified permissions string. This method will throw anIllegalArgumentException
if it encounters a character that does not correspond to a valid permission.- Parameters:
permissionString
- AString
which represents thePathSasPermission
.- Returns:
- A
PathSasPermission
generated from the givenString
. - Throws:
IllegalArgumentException
- IfpermissionString
contains a character other than r, a, c, w, d, l, m, e, o, or p.
-
hasReadPermission
public boolean hasReadPermission()Gets the read permission status.- Returns:
- the read permission status.
-
setReadPermission
Sets the read permission status.- Parameters:
hasReadPermission
- Permission status to set- Returns:
- the updated PathSasPermission object.
-
hasAddPermission
public boolean hasAddPermission()Gets the add permission status.- Returns:
- the add permission status.
-
setAddPermission
Sets the add permission status.- Parameters:
hasAddPermission
- Permission status to set- Returns:
- the updated PathSasPermission object.
-
hasCreatePermission
public boolean hasCreatePermission()Gets the create permission status.- Returns:
- the create permission status.
-
setCreatePermission
Sets the create permission status.- Parameters:
hasCreatePermission
- Permission status to set- Returns:
- the updated PathSasPermission object.
-
hasWritePermission
public boolean hasWritePermission()Gets the write permission status.- Returns:
- the write permission status.
-
setWritePermission
Sets the write permission status.- Parameters:
hasWritePermission
- Permission status to set- Returns:
- the updated PathSasPermission object.
-
hasDeletePermission
public boolean hasDeletePermission()Gets the delete permission status.- Returns:
- the delete permission status.
-
setDeletePermission
Sets the delete permission status.- Parameters:
hasDeletePermission
- Permission status to set- Returns:
- the updated PathSasPermission object.
-
hasListPermission
public boolean hasListPermission()Gets the list permission status.- Returns:
- the list permission status.
-
setListPermission
Sets the list permission status.- Parameters:
hasListPermission
- Permission status to set- Returns:
- the updated PathSasPermission object.
-
hasMovePermission
public boolean hasMovePermission()Gets the move permission status.- Returns:
- the move permission status.
-
setMovePermission
Sets the move permission status.- Parameters:
hasMovePermission
- Permission status to set- Returns:
- the updated PathSasPermission object.
-
hasExecutePermission
public boolean hasExecutePermission()Gets the execute permission status.- Returns:
- the execute permission status.
-
setExecutePermission
Sets the execute permission status.- Parameters:
hasExecutePermission
- Permission status to set- Returns:
- the updated PathSasPermission object.
-
hasManageOwnershipPermission
public boolean hasManageOwnershipPermission()Gets the manage ownership permission status.- Returns:
- the manage ownership permission status.
-
setManageOwnershipPermission
Sets the manage ownership permission status.- Parameters:
hasManageOwnershipPermission
- Permission status to set- Returns:
- the updated PathSasPermission object.
-
hasManageAccessControlPermission
public boolean hasManageAccessControlPermission()Gets the manage access control permission status.- Returns:
- the manage access control permission status.
-
setManageAccessControlPermission
Sets the manage access control permission status.- Parameters:
hasManageAccessControlPermission
- Permission status to set- Returns:
- the updated PathSasPermission object.
-
toString
Converts the given permissions to aString
. Using this method will guarantee the permissions are in an order accepted by the service.
-