public final class ShareFileSasPermission extends Object
toString()
and set as the permissions field on
ShareServiceSasSignatureValues
.
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 and Description |
---|
ShareFileSasPermission()
Initializes an
ShareFileSasPermission object with all fields set to false. |
Modifier and Type | Method and Description |
---|---|
boolean |
hasCreatePermission()
Gets the create permission status.
|
boolean |
hasDeletePermission()
Gets the delete permission status.
|
boolean |
hasReadPermission()
Gets the read permission status.
|
boolean |
hasWritePermission()
Gets the write permission status.
|
static ShareFileSasPermission |
parse(String permString)
Creates an
ShareFileSasPermission from the specified permissions string. |
ShareFileSasPermission |
setCreatePermission(boolean hasCreatePermission)
Sets the create permission status.
|
ShareFileSasPermission |
setDeletePermission(boolean hasDeletePermission)
Sets the delete permission status.
|
ShareFileSasPermission |
setReadPermission(boolean hasReadPermission)
Sets the read permission status.
|
ShareFileSasPermission |
setWritePermission(boolean hasWritePermission)
Sets the write permission status.
|
String |
toString()
Converts the given permissions to a
String . |
public ShareFileSasPermission()
ShareFileSasPermission
object with all fields set to false.public static ShareFileSasPermission parse(String permString)
ShareFileSasPermission
from the specified permissions string. This method will throw an
IllegalArgumentException
if it encounters a character that does not correspond to a valid permission.permString
- A String
which represents the ShareFileSasPermission
.ShareFileSasPermission
generated from the given String
.IllegalArgumentException
- If permString
contains a character other than r, c, w, or d.public boolean hasReadPermission()
true
if the SAS can read the content, properties, and metadata for a file. Can use the file as
the source of a copy operation. false
, otherwise.public ShareFileSasPermission setReadPermission(boolean hasReadPermission)
hasReadPermission
- true
if the SAS can read the content, properties, and metadata for a file. Can
use the file as the source of a copy operation. false
, otherwise.public boolean hasCreatePermission()
true
if SAS can create a new file or copy a file to a new file. false
, otherwise.public ShareFileSasPermission setCreatePermission(boolean hasCreatePermission)
hasCreatePermission
- true
if SAS can create a new file or copy a file to a new file. false
,
otherwise.public boolean hasWritePermission()
true
if SAS can write content, properties, or metadata to the file. Or, use the file as the
destination of a copy operation. false
, otherwise.public ShareFileSasPermission setWritePermission(boolean hasWritePermission)
hasWritePermission
- true
if SAS can write content, properties, or metadata to the file. Or, use the
file as the destination of a copy operation. false
, otherwise.public boolean hasDeletePermission()
true
if SAS can delete a file. false
, otherwise.public ShareFileSasPermission setDeletePermission(boolean hasDeletePermission)
hasDeletePermission
- true
if SAS can delete a file. false
, otherwise.Copyright © 2020 Microsoft Corporation. All rights reserved.