Package com.azure.storage.common.sas
Class AccountSasService
- java.lang.Object
-
- com.azure.storage.common.sas.AccountSasService
-
public final class AccountSasService extends Object
This is a helper class to construct a string representing the services accessible by an AccountSAS. Setting a value to true means that any SAS which uses these permissions will grant access to that service. Once all the values are set, this should be serialized with toString and set as the services field on anAccountSasSignatureValues
object. It is possible to construct the services string without this class, but the order of the services is particular and this class guarantees correctness.
-
-
Constructor Summary
Constructors Constructor Description AccountSasService()
Initializes anAccountSasService
object with all fields set to false.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
hasBlobAccess()
boolean
hasFileAccess()
boolean
hasQueueAccess()
boolean
hasTableAccess()
static AccountSasService
parse(String servicesString)
Creates anAccountSasService
from the specified services string.AccountSasService
setBlobAccess(boolean blob)
Sets the access status for blob resources.AccountSasService
setFileAccess(boolean file)
Sets the access status for file resources.AccountSasService
setQueueAccess(boolean queue)
Sets the access status for queue resources.AccountSasService
setTableAccess(boolean table)
Sets the access status for table resources.String
toString()
Converts the given services to aString
.
-
-
-
Method Detail
-
parse
public static AccountSasService parse(String servicesString)
Creates anAccountSasService
from the specified services string. This method will throw anIllegalArgumentException
if it encounters a character that does not correspond to a valid service.- Parameters:
servicesString
- AString
which represents theSharedAccessAccountServices
.- Returns:
- A
AccountSasService
generated from the givenString
. - Throws:
IllegalArgumentException
- IfservicesString
contains a character other than b, f, q, or t.
-
hasBlobAccess
public boolean hasBlobAccess()
- Returns:
- the access status for blob resources.
-
setBlobAccess
public AccountSasService setBlobAccess(boolean blob)
Sets the access status for blob resources.- Parameters:
blob
- Access status to set- Returns:
- the updated AccountSasService object.
-
hasFileAccess
public boolean hasFileAccess()
- Returns:
- the access status for file resources.
-
setFileAccess
public AccountSasService setFileAccess(boolean file)
Sets the access status for file resources.- Parameters:
file
- Access status to set- Returns:
- the updated AccountSasService object.
-
hasQueueAccess
public boolean hasQueueAccess()
- Returns:
- the access status for queue resources.
-
setQueueAccess
public AccountSasService setQueueAccess(boolean queue)
Sets the access status for queue resources.- Parameters:
queue
- Access status to set- Returns:
- the updated AccountSasService object.
-
hasTableAccess
public boolean hasTableAccess()
- Returns:
- the access status for table resources.
-
setTableAccess
public AccountSasService setTableAccess(boolean table)
Sets the access status for table resources.- Parameters:
table
- Access status to set- Returns:
- the updated AccountSasService object.
-
-