BlobSasPermission Class

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

public final class BlobSasPermission

This is a helper class to construct a string representing the permissions granted by a ServiceSAS to a blob. 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
BlobSasPermission()

Initializes a BlobSasPermission 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 hasImmutabilityPolicyPermission()
boolean hasListPermission()
boolean hasMovePermission()
boolean hasPermanentDeletePermission()
boolean hasReadPermission()
boolean hasTagsPermission()
boolean hasWritePermission()
static BlobSasPermission parse(String permissionString)

Creates a BlobSasPermission from the specified permissions string.

BlobSasPermission setAddPermission(boolean hasAddPermission)

Sets the add permission status.

BlobSasPermission setCreatePermission(boolean hasCreatePermission)

Sets the create permission status.

BlobSasPermission setDeletePermission(boolean hasDeletePermission)

Sets the delete permission status.

BlobSasPermission setDeleteVersionPermission(boolean hasDeleteVersionPermission)

Sets the delete version permission status.

BlobSasPermission setExecutePermission(boolean hasExecutePermission)

Sets the execute permission status.

BlobSasPermission setImmutabilityPolicyPermission(boolean immutabilityPolicyPermission)

Sets the set immutability policy permission status.

BlobSasPermission setListPermission(boolean hasListPermission)

Sets the list permission status.

BlobSasPermission setMovePermission(boolean hasMovePermission)

Sets the move permission status.

BlobSasPermission setPermanentDeletePermission(boolean permanentDeletePermission)

Sets the permanent delete permission status.

BlobSasPermission setReadPermission(boolean hasReadPermission)

Sets the read permission status.

BlobSasPermission setTagsPermission(boolean tagsPermission)

Sets the tags permission status.

BlobSasPermission 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

BlobSasPermission

public BlobSasPermission()

Initializes a BlobSasPermission 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.

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.

hasPermanentDeletePermission

public boolean hasPermanentDeletePermission()

Returns:

the permanent delete 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 BlobSasPermission parse(String permissionString)

Creates a BlobSasPermission 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 BlobSasPermission.

Returns:

A BlobSasPermission generated from the given String.

setAddPermission

public BlobSasPermission setAddPermission(boolean hasAddPermission)

Sets the add permission status.

Parameters:

hasAddPermission - Permission status to set

Returns:

the updated BlobSasPermission object.

setCreatePermission

public BlobSasPermission setCreatePermission(boolean hasCreatePermission)

Sets the create permission status.

Parameters:

hasCreatePermission - Permission status to set

Returns:

the updated BlobSasPermission object.

setDeletePermission

public BlobSasPermission setDeletePermission(boolean hasDeletePermission)

Sets the delete permission status.

Parameters:

hasDeletePermission - Permission status to set

Returns:

the updated BlobSasPermission object.

setDeleteVersionPermission

public BlobSasPermission setDeleteVersionPermission(boolean hasDeleteVersionPermission)

Sets the delete version permission status.

Parameters:

hasDeleteVersionPermission - Permission status to set

Returns:

the updated BlobSasPermission object.

setExecutePermission

public BlobSasPermission setExecutePermission(boolean hasExecutePermission)

Sets the execute permission status.

Parameters:

hasExecutePermission - Permission status to set

Returns:

the updated BlobSasPermission object.

setImmutabilityPolicyPermission

public BlobSasPermission setImmutabilityPolicyPermission(boolean immutabilityPolicyPermission)

Sets the set immutability policy permission status.

Parameters:

immutabilityPolicyPermission - Permission status to set

Returns:

the updated BlobSasPermission object.

setListPermission

public BlobSasPermission setListPermission(boolean hasListPermission)

Sets the list permission status.

Parameters:

hasListPermission - Permission status to set

Returns:

the updated BlobSasPermission object.

setMovePermission

public BlobSasPermission setMovePermission(boolean hasMovePermission)

Sets the move permission status.

Parameters:

hasMovePermission - Permission status to set

Returns:

the updated BlobSasPermission object.

setPermanentDeletePermission

public BlobSasPermission setPermanentDeletePermission(boolean permanentDeletePermission)

Sets the permanent delete permission status.

Parameters:

permanentDeletePermission - Permission status to set

Returns:

the updated BlobSasPermission object.

setReadPermission

public BlobSasPermission setReadPermission(boolean hasReadPermission)

Sets the read permission status.

Parameters:

hasReadPermission - Permission status to set

Returns:

the updated BlobSasPermission object.

setTagsPermission

public BlobSasPermission setTagsPermission(boolean tagsPermission)

Sets the tags permission status.

Parameters:

tagsPermission - Permission status to set

Returns:

the updated BlobSasPermission object.

setWritePermission

public BlobSasPermission setWritePermission(boolean hasWritePermission)

Sets the write permission status.

Parameters:

hasWritePermission - Permission status to set

Returns:

the updated BlobSasPermission 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:

BlobSasPermission.toString()

Returns:

A String which represents the BlobSasPermission.

Applies to