Compartir a través de


AccountSasResourceType Class

  • java.lang.Object
    • com.azure.storage.common.sas.AccountSasResourceType

public final class AccountSasResourceType

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 an AccountSasSignatureValues 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

Constructor Description
AccountSasResourceType()

Initializes an AccountSasResourceType object with all fields set to false.

Method Summary

Modifier and Type Method and Description
boolean isContainer()

Gets the access status for container level APIs.

boolean isObject()

Gets the access status for object level APIs.

boolean isService()

Gets the access status for service level APIs.

static AccountSasResourceType parse(String resourceTypesString)

Creates an AccountSasResourceType 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 a String.

Methods inherited from java.lang.Object

Constructor Details

AccountSasResourceType

public AccountSasResourceType()

Initializes an AccountSasResourceType object with all fields set to false.

Method Details

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.

isObject

public boolean isObject()

Gets 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.

isService

public boolean isService()

Gets the access status for service level APIs.

Returns:

the access status for service level APIs.

parse

public static AccountSasResourceType parse(String resourceTypesString)

Creates an AccountSasResourceType from the specified resource types string. This method will throw an IllegalArgumentException if it encounters a character that does not correspond to a valid resource type.

Parameters:

resourceTypesString - A String which represents the AccountSASResourceTypes.

Returns:

A AccountSasResourceType generated from the given String.

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.

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.

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.

toString

public String toString()

Converts the given resource types to a String. Using this method will guarantee the resource types are in an order accepted by the service.

Overrides:

AccountSasResourceType.toString()

Returns:

A String which represents the AccountSASResourceTypes.

Applies to