PathSasPermission Class

  • java.lang.Object
    • com.azure.storage.file.datalake.sas.PathSasPermission

public final class PathSasPermission

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

Initializes a PathSasPermission object with all fields set to false.

Method Summary

Modifier and Type Method and Description
boolean hasAddPermission()
boolean hasCreatePermission()
boolean hasDeletePermission()
boolean hasExecutePermission()
boolean hasListPermission()
boolean hasManageAccessControlPermission()
boolean hasManageOwnershipPermission()
boolean hasMovePermission()
boolean hasReadPermission()
boolean hasWritePermission()
static PathSasPermission parse(String permissionString)

Creates a PathSasPermission from the specified permissions string.

PathSasPermission setAddPermission(boolean hasAddPermission)

Sets the add permission status.

PathSasPermission setCreatePermission(boolean hasCreatePermission)

Sets the create permission status.

PathSasPermission setDeletePermission(boolean hasDeletePermission)

Sets the delete permission status.

PathSasPermission setExecutePermission(boolean hasExecutePermission)

Sets the execute permission status.

PathSasPermission setListPermission(boolean hasListPermission)

Sets the list permission status.

PathSasPermission setManageAccessControlPermission(boolean hasManageAccessControlPermission)

Sets the manage access control permission status.

PathSasPermission setManageOwnershipPermission(boolean hasManageOwnershipPermission)

Sets the manage ownership permission status.

PathSasPermission setMovePermission(boolean hasMovePermission)

Sets the move permission status.

PathSasPermission setReadPermission(boolean hasReadPermission)

Sets the read permission status.

PathSasPermission 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

PathSasPermission

public PathSasPermission()

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

hasExecutePermission

public boolean hasExecutePermission()

Returns:

the execute permission status.

hasListPermission

public boolean hasListPermission()

Returns:

the list permission status.

hasManageAccessControlPermission

public boolean hasManageAccessControlPermission()

Returns:

the manage access control permission status.

hasManageOwnershipPermission

public boolean hasManageOwnershipPermission()

Returns:

the manage ownership permission status.

hasMovePermission

public boolean hasMovePermission()

Returns:

the move permission status.

hasReadPermission

public boolean hasReadPermission()

Returns:

the read permission status.

hasWritePermission

public boolean hasWritePermission()

Returns:

the write permission status.

parse

public static PathSasPermission parse(String permissionString)

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

Returns:

A PathSasPermission generated from the given String.

setAddPermission

public PathSasPermission setAddPermission(boolean hasAddPermission)

Sets the add permission status.

Parameters:

hasAddPermission - Permission status to set

Returns:

the updated PathSasPermission object.

setCreatePermission

public PathSasPermission setCreatePermission(boolean hasCreatePermission)

Sets the create permission status.

Parameters:

hasCreatePermission - Permission status to set

Returns:

the updated PathSasPermission object.

setDeletePermission

public PathSasPermission setDeletePermission(boolean hasDeletePermission)

Sets the delete permission status.

Parameters:

hasDeletePermission - Permission status to set

Returns:

the updated PathSasPermission object.

setExecutePermission

public PathSasPermission setExecutePermission(boolean hasExecutePermission)

Sets the execute permission status.

Parameters:

hasExecutePermission - Permission status to set

Returns:

the updated PathSasPermission object.

setListPermission

public PathSasPermission setListPermission(boolean hasListPermission)

Sets the list permission status.

Parameters:

hasListPermission - Permission status to set

Returns:

the updated PathSasPermission object.

setManageAccessControlPermission

public PathSasPermission setManageAccessControlPermission(boolean hasManageAccessControlPermission)

Sets the manage access control permission status.

Parameters:

hasManageAccessControlPermission - Permission status to set

Returns:

the updated PathSasPermission object.

setManageOwnershipPermission

public PathSasPermission setManageOwnershipPermission(boolean hasManageOwnershipPermission)

Sets the manage ownership permission status.

Parameters:

hasManageOwnershipPermission - Permission status to set

Returns:

the updated PathSasPermission object.

setMovePermission

public PathSasPermission setMovePermission(boolean hasMovePermission)

Sets the move permission status.

Parameters:

hasMovePermission - Permission status to set

Returns:

the updated PathSasPermission object.

setReadPermission

public PathSasPermission setReadPermission(boolean hasReadPermission)

Sets the read permission status.

Parameters:

hasReadPermission - Permission status to set

Returns:

the updated PathSasPermission object.

setWritePermission

public PathSasPermission setWritePermission(boolean hasWritePermission)

Sets the write permission status.

Parameters:

hasWritePermission - Permission status to set

Returns:

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

PathSasPermission.toString()

Returns:

A String which represents the PathSasPermission.

Applies to