Partilhar via


BlobContainerSasPermission Class

  • java.lang.Object
    • com.azure.storage.blob.sas.BlobContainerSasPermission

public final class BlobContainerSasPermission

This is a helper class to construct a string representing the permissions granted by a ServiceSAS to a container. Setting a value to true means that any SAS which uses these permissions will grant permissions for that operation. It is possible to construct the permissions string without this class, but the order of the permissions is particular and this class guarantees correctness.

Constructor Summary

Constructor Description
BlobContainerSasPermission()

Initializes an BlobContainerSasPermission object with all fields set to false.

Method Summary

Modifier and Type Method and Description
boolean hasAddPermission()
boolean hasCreatePermission()
boolean hasDeletePermission()
boolean hasDeleteVersionPermission()
boolean hasExecutePermission()
boolean hasFilterPermission()
boolean hasImmutabilityPolicyPermission()
boolean hasListPermission()
boolean hasMovePermission()
boolean hasReadPermission()
boolean hasTagsPermission()
boolean hasWritePermission()
static BlobContainerSasPermission parse(String permissionString)

Creates an BlobContainerSasPermission from the specified permissions string.

BlobContainerSasPermission setAddPermission(boolean hasAddPermission)

Sets the add permission status.

BlobContainerSasPermission setCreatePermission(boolean hasCreatePermission)

Sets the create permission status.

BlobContainerSasPermission setDeletePermission(boolean hasDeletePermission)

Sets the delete permission status.

BlobContainerSasPermission setDeleteVersionPermission(boolean hasDeleteVersionPermission)

Sets the delete version permission status.

BlobContainerSasPermission setExecutePermission(boolean hasExecutePermission)

Sets the execute permission status.

BlobContainerSasPermission setFilterPermission(boolean hasFilterPermission)

Sets the filter permission status.

BlobContainerSasPermission setImmutabilityPolicyPermission(boolean immutabilityPolicyPermission)

Sets the set immutability policy permission status.

BlobContainerSasPermission setListPermission(boolean hasListPermission)

Sets the list permission status.

BlobContainerSasPermission setMovePermission(boolean hasMovePermission)

Sets the move permission status.

BlobContainerSasPermission setReadPermission(boolean hasReadPermission)

Sets the read permission status.

BlobContainerSasPermission setTagsPermission(boolean tagsPermission)

Sets the tags permission status.

BlobContainerSasPermission setWritePermission(boolean hasWritePermission)

Sets the write permission status.

String toString()

Converts the given permissions to a String.

Methods inherited from java.lang.Object

Constructor Details

BlobContainerSasPermission

public BlobContainerSasPermission()

Initializes an BlobContainerSasPermission object with all fields set to false.

Method Details

hasAddPermission

public boolean hasAddPermission()

Returns:

the add permission status

hasCreatePermission

public boolean hasCreatePermission()

Returns:

the create permission status

hasDeletePermission

public boolean hasDeletePermission()

Returns:

the delete permission status

hasDeleteVersionPermission

public boolean hasDeleteVersionPermission()

Returns:

the delete version permission status

hasExecutePermission

public boolean hasExecutePermission()

Returns:

the execute permission status.

hasFilterPermission

public boolean hasFilterPermission()

Returns:

the filter permission status.

hasImmutabilityPolicyPermission

public boolean hasImmutabilityPolicyPermission()

Returns:

the set immutability policy permission status.

hasListPermission

public boolean hasListPermission()

Returns:

the list permission status

hasMovePermission

public boolean hasMovePermission()

Returns:

the move permission status.

hasReadPermission

public boolean hasReadPermission()

Returns:

the read permission status

hasTagsPermission

public boolean hasTagsPermission()

Returns:

the tags permission status.

hasWritePermission

public boolean hasWritePermission()

Returns:

the write permission status

parse

public static BlobContainerSasPermission parse(String permissionString)

Creates an BlobContainerSasPermission from the specified permissions string. This method will throw an IllegalArgumentException if it encounters a character that does not correspond to a valid permission.

Parameters:

permissionString - A String which represents the BlobContainerSasPermission.

Returns:

A BlobContainerSasPermission generated from the given String.

setAddPermission

public BlobContainerSasPermission setAddPermission(boolean hasAddPermission)

Sets the add permission status.

Parameters:

hasAddPermission - Permission status to set

Returns:

the updated BlobContainerSasPermission object

setCreatePermission

public BlobContainerSasPermission setCreatePermission(boolean hasCreatePermission)

Sets the create permission status.

Parameters:

hasCreatePermission - Permission status to set

Returns:

the updated BlobContainerSasPermission object

setDeletePermission

public BlobContainerSasPermission setDeletePermission(boolean hasDeletePermission)

Sets the delete permission status.

Parameters:

hasDeletePermission - Permission status to set

Returns:

the updated BlobContainerSasPermission object

setDeleteVersionPermission

public BlobContainerSasPermission setDeleteVersionPermission(boolean hasDeleteVersionPermission)

Sets the delete version permission status.

Parameters:

hasDeleteVersionPermission - Permission status to set

Returns:

the updated BlobContainerSasPermission object

setExecutePermission

public BlobContainerSasPermission setExecutePermission(boolean hasExecutePermission)

Sets the execute permission status.

Parameters:

hasExecutePermission - Permission status to set

Returns:

the updated BlobContainerSasPermission object.

setFilterPermission

public BlobContainerSasPermission setFilterPermission(boolean hasFilterPermission)

Sets the filter permission status.

Parameters:

hasFilterPermission - Permission status to set

Returns:

the updated BlobSasPermission object.

setImmutabilityPolicyPermission

public BlobContainerSasPermission setImmutabilityPolicyPermission(boolean immutabilityPolicyPermission)

Sets the set immutability policy permission status.

Parameters:

immutabilityPolicyPermission - Permission status to set

Returns:

the updated BlobSasPermission object.

setListPermission

public BlobContainerSasPermission setListPermission(boolean hasListPermission)

Sets the list permission status.

Parameters:

hasListPermission - Permission status to set

Returns:

the updated BlobContainerSasPermission object

setMovePermission

public BlobContainerSasPermission setMovePermission(boolean hasMovePermission)

Sets the move permission status.

Parameters:

hasMovePermission - Permission status to set

Returns:

the updated BlobContainerSasPermission object.

setReadPermission

public BlobContainerSasPermission setReadPermission(boolean hasReadPermission)

Sets the read permission status.

Parameters:

hasReadPermission - Permission status to set

Returns:

the updated BlobContainerSasPermission object

setTagsPermission

public BlobContainerSasPermission setTagsPermission(boolean tagsPermission)

Sets the tags permission status.

Parameters:

tagsPermission - Permission status to set

Returns:

the updated BlobContainerSasPermission object.

setWritePermission

public BlobContainerSasPermission setWritePermission(boolean hasWritePermission)

Sets the write permission status.

Parameters:

hasWritePermission - Permission status to set

Returns:

the updated BlobContainerSasPermission object

toString

public String toString()

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

Overrides:

BlobContainerSasPermission.toString()

Returns:

A String which represents the BlobContainerSasPermission.

Applies to