你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn。
AccountSasService Class
- java.
lang. Object - com.
azure. storage. common. sas. AccountSasService
- com.
public final class AccountSasService
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 an AccountSasSignatureValues 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
Constructor | Description |
---|---|
AccountSasService() |
Initializes an |
Method Summary
Modifier and Type | Method and Description |
---|---|
boolean |
hasBlobAccess()
Gets the access status for blob resources. |
boolean |
hasFileAccess()
Gets the access status for file resources. |
boolean |
hasQueueAccess()
Gets the access status for queue resources. |
boolean |
hasTableAccess()
Gets the access status for table resources. |
static
Account |
parse(String servicesString)
Creates an |
Account |
setBlobAccess(boolean blob)
Sets the access status for blob resources. |
Account |
setFileAccess(boolean file)
Sets the access status for file resources. |
Account |
setQueueAccess(boolean queue)
Sets the access status for queue resources. |
Account |
setTableAccess(boolean table)
Sets the access status for table resources. |
String |
toString()
Converts the given services to a |
Methods inherited from java.lang.Object
Constructor Details
AccountSasService
public AccountSasService()
Initializes an AccountSasService
object with all fields set to false.
Method Details
hasBlobAccess
public boolean hasBlobAccess()
Gets the access status for blob resources.
Returns:
hasFileAccess
public boolean hasFileAccess()
Gets the access status for file resources.
Returns:
hasQueueAccess
public boolean hasQueueAccess()
Gets the access status for queue resources.
Returns:
hasTableAccess
public boolean hasTableAccess()
Gets the access status for table resources.
Returns:
parse
public static AccountSasService parse(String servicesString)
Creates an AccountSasService
from the specified services string. This method will throw an IllegalArgumentException
if it encounters a character that does not correspond to a valid service.
Parameters:
String
which represents the SharedAccessAccountServices
.
Returns:
AccountSasService
generated from the given String
.setBlobAccess
public AccountSasService setBlobAccess(boolean blob)
Sets the access status for blob resources.
Parameters:
Returns:
setFileAccess
public AccountSasService setFileAccess(boolean file)
Sets the access status for file resources.
Parameters:
Returns:
setQueueAccess
public AccountSasService setQueueAccess(boolean queue)
Sets the access status for queue resources.
Parameters:
Returns:
setTableAccess
public AccountSasService setTableAccess(boolean table)
Sets the access status for table resources.
Parameters:
Returns:
toString
public String toString()
Converts the given services to a String
. Using this method will guarantee the services are in an order accepted by the service.
Overrides:
AccountSasService.toString()Returns:
String
which represents the AccountSASServices
.