Package com.azure.data.tables.sas
Class TableAccountSasResourceType
java.lang.Object
com.azure.data.tables.sas.TableAccountSasResourceType
This is a helper class to construct a string representing the resources accessible by an Account SAS. 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 an
TableAccountSasSignatureValues
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
-
Method Summary
Modifier and TypeMethodDescriptionboolean
Gets the access status for container level APIs, this grants access to Blob Containers, Tables, Queues, and File Shares.boolean
isObject()
Get the access status for object level APIs, this grants access to Blobs, Table Entities, Queue Messages, Files.boolean
Get the access status for service level APIs.static TableAccountSasResourceType
Creates anTableAccountSasResourceType
from the specified resource types string.setContainer
(boolean container) Sets the access status for container level APIs, this grants access to Blob Containers, Tables, Queues, and File Shares.setObject
(boolean object) Sets the access status for object level APIs, this grants access to Blobs, Table Entities, Queue Messages, Files.setService
(boolean service) Sets the access status for service level APIs.toString()
Converts the given resource types to aString
.
-
Constructor Details
-
TableAccountSasResourceType
public TableAccountSasResourceType()
-
-
Method Details
-
parse
Creates anTableAccountSasResourceType
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 theaccount resource types
.- Returns:
- A
TableAccountSasResourceType
generated from the givenString
. - Throws:
IllegalArgumentException
- IfresourceTypesString
contains a character other than s, c, or o.
-
isService
public boolean isService()Get the access status for service level APIs.- Returns:
- The access status for service level APIs.
-
setService
Sets the access status for service level APIs.- Parameters:
service
- The access status to set.- Returns:
- The updated
TableAccountSasResourceType
object.
-
isContainer
public boolean isContainer()Gets the access status for container level APIs, this grants access to Blob Containers, Tables, Queues, and File Shares.- Returns:
- The access status for container level APIs, this grants access to Blob Containers, Tables, Queues, and File Shares.
-
setContainer
Sets the access status for container level APIs, this grants access to Blob Containers, Tables, Queues, and File Shares.- Parameters:
container
- The access status to set.- Returns:
- The updated
TableAccountSasResourceType
object.
-
isObject
public boolean isObject()Get the access status for object level APIs, this grants access to Blobs, Table Entities, Queue Messages, Files.- Returns:
- The access status for object level APIs, this grants access to Blobs, Table Entities, Queue Messages, Files.
-
setObject
Sets the access status for object level APIs, this grants access to Blobs, Table Entities, Queue Messages, Files.- Parameters:
object
- The access status to set.- Returns:
- The updated
TableAccountSasResourceType
object.
-
toString
Converts the given resource types to aString
. Using this method will guarantee the resource types are in an order accepted by the service. If all resource types are set to false, an empty string is returned from this method.- Overrides:
toString
in classObject
- Returns:
- A
String
which represents theaccount resource types
.
-