BlobSasPermission Class
- java.
lang. Object - com.
azure. storage. blob. sas. BlobSasPermission
- com.
public final class BlobSasPermission
This is a helper class to construct a string representing the permissions granted by a ServiceSAS to a blob. 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
Constructor | Description |
---|---|
BlobSasPermission() |
Initializes a |
Method Summary
Modifier and Type | Method and Description |
---|---|
boolean |
hasAddPermission()
Gets the add permission status. |
boolean |
hasCreatePermission()
Gets the create permission status. |
boolean |
hasDeletePermission()
Gets the delete permission status. |
boolean |
hasDeleteVersionPermission()
Gets the delete version permission status. |
boolean |
hasExecutePermission()
Gets the execute permission status. |
boolean |
hasImmutabilityPolicyPermission()
Gets the set immutability policy permission status. |
boolean |
hasListPermission()
Gets the list permission status. |
boolean |
hasMovePermission()
Gets the move permission status. |
boolean |
hasPermanentDeletePermission()
Gets the permanent delete permission status. |
boolean |
hasReadPermission()
Gets the read permission status. |
boolean |
hasTagsPermission()
Gets the tags permission status. |
boolean |
hasWritePermission()
Gets the write permission status. |
static
Blob |
parse(String permissionString)
Creates a |
Blob |
setAddPermission(boolean hasAddPermission)
Sets the add permission status. |
Blob |
setCreatePermission(boolean hasCreatePermission)
Sets the create permission status. |
Blob |
setDeletePermission(boolean hasDeletePermission)
Sets the delete permission status. |
Blob |
setDeleteVersionPermission(boolean hasDeleteVersionPermission)
Sets the delete version permission status. |
Blob |
setExecutePermission(boolean hasExecutePermission)
Sets the execute permission status. |
Blob |
setImmutabilityPolicyPermission(boolean immutabilityPolicyPermission)
Sets the set immutability policy permission status. |
Blob |
setListPermission(boolean hasListPermission)
Sets the list permission status. |
Blob |
setMovePermission(boolean hasMovePermission)
Sets the move permission status. |
Blob |
setPermanentDeletePermission(boolean permanentDeletePermission)
Sets the permanent delete permission status. |
Blob |
setReadPermission(boolean hasReadPermission)
Sets the read permission status. |
Blob |
setTagsPermission(boolean tagsPermission)
Sets the tags permission status. |
Blob |
setWritePermission(boolean hasWritePermission)
Sets the write permission status. |
String |
toString()
Converts the given permissions to a |
Methods inherited from java.lang.Object
Constructor Details
BlobSasPermission
public BlobSasPermission()
Initializes a BlobSasPermission
object with all fields set to false.
Method Details
hasAddPermission
public boolean hasAddPermission()
Gets the add permission status.
Returns:
hasCreatePermission
public boolean hasCreatePermission()
Gets the create permission status.
Returns:
hasDeletePermission
public boolean hasDeletePermission()
Gets the delete permission status.
Returns:
hasDeleteVersionPermission
public boolean hasDeleteVersionPermission()
Gets the delete version permission status.
Returns:
hasExecutePermission
public boolean hasExecutePermission()
Gets the execute permission status.
Returns:
hasImmutabilityPolicyPermission
public boolean hasImmutabilityPolicyPermission()
Gets the set immutability policy permission status.
Returns:
hasListPermission
public boolean hasListPermission()
Gets the list permission status.
Returns:
hasMovePermission
public boolean hasMovePermission()
Gets the move permission status.
Returns:
hasPermanentDeletePermission
public boolean hasPermanentDeletePermission()
Gets the permanent delete permission status.
Returns:
hasReadPermission
public boolean hasReadPermission()
Gets the read permission status.
Returns:
hasTagsPermission
public boolean hasTagsPermission()
Gets the tags permission status.
Returns:
hasWritePermission
public boolean hasWritePermission()
Gets the write permission status.
Returns:
parse
public static BlobSasPermission parse(String permissionString)
Creates a BlobSasPermission
from the specified permissions string. This method will throw an IllegalArgumentException
if it encounters a character that does not correspond to a valid permission.
Parameters:
String
which represents the BlobSasPermission
.
Returns:
BlobSasPermission
generated from the given String
.setAddPermission
public BlobSasPermission setAddPermission(boolean hasAddPermission)
Sets the add permission status.
Parameters:
Returns:
setCreatePermission
public BlobSasPermission setCreatePermission(boolean hasCreatePermission)
Sets the create permission status.
Parameters:
Returns:
setDeletePermission
public BlobSasPermission setDeletePermission(boolean hasDeletePermission)
Sets the delete permission status.
Parameters:
Returns:
setDeleteVersionPermission
public BlobSasPermission setDeleteVersionPermission(boolean hasDeleteVersionPermission)
Sets the delete version permission status.
Parameters:
Returns:
setExecutePermission
public BlobSasPermission setExecutePermission(boolean hasExecutePermission)
Sets the execute permission status.
Parameters:
Returns:
setImmutabilityPolicyPermission
public BlobSasPermission setImmutabilityPolicyPermission(boolean immutabilityPolicyPermission)
Sets the set immutability policy permission status.
Parameters:
Returns:
setListPermission
public BlobSasPermission setListPermission(boolean hasListPermission)
Sets the list permission status.
Parameters:
Returns:
setMovePermission
public BlobSasPermission setMovePermission(boolean hasMovePermission)
Sets the move permission status.
Parameters:
Returns:
setPermanentDeletePermission
public BlobSasPermission setPermanentDeletePermission(boolean permanentDeletePermission)
Sets the permanent delete permission status.
Parameters:
Returns:
setReadPermission
public BlobSasPermission setReadPermission(boolean hasReadPermission)
Sets the read permission status.
Parameters:
Returns:
setTagsPermission
public BlobSasPermission setTagsPermission(boolean tagsPermission)
Sets the tags permission status.
Parameters:
Returns:
setWritePermission
public BlobSasPermission setWritePermission(boolean hasWritePermission)
Sets the write permission status.
Parameters:
Returns:
toString
public String toString()
Converts the given permissions to a String
. Using this method will guarantee the permissions are in an order accepted by the service.
Overrides:
BlobSasPermission.toString()Returns:
String
which represents the BlobSasPermission
.