ShareSasPermission Class
- java.
lang. Object - com.
azure. storage. file. share. sas. ShareSasPermission
- com.
public final class ShareSasPermission
This is a helper class to construct a string representing the permissions granted by a ServiceSAS to a share. Setting a value to true means that any SAS which uses these permissions will grant permissions for that operation. Once all the values are set, this should be serialized with toString and set as the permissions field on a ShareServiceSasSignatureValues object. 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 |
---|---|
ShareSasPermission() |
Initializes an |
Method Summary
Modifier and Type | Method and Description |
---|---|
boolean | hasCreatePermission() |
boolean | hasDeletePermission() |
boolean | hasListPermission() |
boolean | hasReadPermission() |
boolean | hasWritePermission() |
static
Share |
parse(String permissionString)
Creates an |
Share |
setCreatePermission(boolean hasCreatePermission)
Sets the create permission status. |
Share |
setDeletePermission(boolean hasDeletePermission)
Sets the delete permission status. |
Share |
setListPermission(boolean hasListPermission)
Sets the list permission status. |
Share |
setReadPermission(boolean hasReadPermission)
Sets the read permission status. |
Share |
setWritePermission(boolean hasWritePermission)
Sets the write permission status. |
String |
toString()
Converts the given permissions to a |
Methods inherited from java.lang.Object
Constructor Details
ShareSasPermission
public ShareSasPermission()
Initializes an ShareSasPermission
object with all fields set to false.
Method Details
hasCreatePermission
public boolean hasCreatePermission()
Returns:
hasDeletePermission
public boolean hasDeletePermission()
Returns:
hasListPermission
public boolean hasListPermission()
Returns:
hasReadPermission
public boolean hasReadPermission()
Returns:
hasWritePermission
public boolean hasWritePermission()
Returns:
parse
public static ShareSasPermission parse(String permissionString)
Creates an ShareSasPermission
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 ShareSasPermission
.
Returns:
ShareSasPermission
generated from the given String
.setCreatePermission
public ShareSasPermission setCreatePermission(boolean hasCreatePermission)
Sets the create permission status.
Parameters:
Returns:
setDeletePermission
public ShareSasPermission setDeletePermission(boolean hasDeletePermission)
Sets the delete permission status.
Parameters:
Returns:
setListPermission
public ShareSasPermission setListPermission(boolean hasListPermission)
Sets the list permission status.
Parameters:
Returns:
setReadPermission
public ShareSasPermission setReadPermission(boolean hasReadPermission)
Sets the read permission status.
Parameters:
Returns:
setWritePermission
public ShareSasPermission 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:
ShareSasPermission.toString()Returns:
String
which represents the ShareSasPermission
.Applies to
Azure SDK for Java