Package com.azure.storage.common.sas
Class AccountSasResourceType
- java.lang.Object
-
- com.azure.storage.common.sas.AccountSasResourceType
-
public final class AccountSasResourceType extends Object
This is a helper class to construct a string representing the resources accessible by an AccountSAS. Setting a value to true means that any SAS which uses these permissions will grant access to that resource type. Once all the values are set, this should be serialized with toString and set as the resources field on anAccountSasSignatureValues
object. It is possible to construct the resources string without this class, but the order of the resources is particular and this class guarantees correctness.
-
-
Constructor Summary
Constructors Constructor Description AccountSasResourceType()
Initializes anAccountSasResourceType
object with all fields set to false.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
isContainer()
boolean
isObject()
boolean
isService()
static AccountSasResourceType
parse(String resourceTypesString)
Creates anAccountSasResourceType
from the specified resource types string.AccountSasResourceType
setContainer(boolean container)
Sets the access status for container level APIs, this grants access to Blob Containers, Tables, Queues, and File Shares.AccountSasResourceType
setObject(boolean object)
Sets the access status for object level APIs, this grants access to Blobs, Table Entities, Queue Messages, Files.AccountSasResourceType
setService(boolean service)
Sets the access status for service level APIs.String
toString()
Converts the given resource types to aString
.
-
-
-
Method Detail
-
parse
public static AccountSasResourceType parse(String resourceTypesString)
Creates anAccountSasResourceType
from the specified resource types string. This method will throw anIllegalArgumentException
if it encounters a character that does not correspond to a valid resource type.- Parameters:
resourceTypesString
- AString
which represents theAccountSASResourceTypes
.- Returns:
- A
AccountSasResourceType
generated from the givenString
. - Throws:
IllegalArgumentException
- IfresourceTypesString
contains a character other than s, c, or o.
-
isService
public boolean isService()
- Returns:
- the access status for service level APIs.
-
setService
public AccountSasResourceType setService(boolean service)
Sets the access status for service level APIs.- Parameters:
service
- Access status to set- Returns:
- the updated AccountSasResourceType object.
-
isContainer
public boolean isContainer()
- Returns:
- the access status for container level APIs, this grants access to Blob Containers, Tables, Queues, and File Shares.
-
setContainer
public AccountSasResourceType setContainer(boolean container)
Sets the access status for container level APIs, this grants access to Blob Containers, Tables, Queues, and File Shares.- Parameters:
container
- Access status to set- Returns:
- the updated AccountSasResourceType object.
-
isObject
public boolean isObject()
- Returns:
- the access status for object level APIs, this grants access to Blobs, Table Entities, Queue Messages, Files.
-
setObject
public AccountSasResourceType setObject(boolean object)
Sets the access status for object level APIs, this grants access to Blobs, Table Entities, Queue Messages, Files.- Parameters:
object
- Access status to set- Returns:
- the updated AccountSasResourceType object.
-
-