public class Access
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
protected java.lang.String |
serializedAccess |
Modifier and Type | Method and Description |
---|---|
void |
overrideEncryptionKey(java.lang.String bucket,
java.lang.String prefix,
EncryptionKey encryptionKey)
Overrides the root encryption key for the prefix in
bucket with encryptionKey.
|
static Access |
parse(java.lang.String serialized)
Parses a base58-encoded
String to an Access . |
java.lang.String |
serialize()
Serializes this
Access to base58-encoded String . |
Access |
share(Permission permission,
SharePrefix... prefixes)
Creates a new access grant with specific permissions.
|
public java.lang.String serialize() throws StorjException
Access
to base58-encoded String
.String
with serialized Access GrantStorjException
- in case of errorpublic static Access parse(java.lang.String serialized) throws StorjException
String
to an Access
.serialized
- a base58-encoded String
Access
GrantStorjException
- in case of errorpublic Access share(Permission permission, SharePrefix... prefixes) throws StorjException
Access grants can only have their existing permissions restricted, and the resulting access grant will only allow for the intersection of all previous Share calls in the access grant construction chain.
Prefixes, if provided, restrict the access grant (and internal encryption information) to only contain enough information to allow access to just those prefixes.
permission
- the permissionprefixes
- list of prefixes to restrict accessStorjException
- if an error occurs during the sharingpublic void overrideEncryptionKey(java.lang.String bucket, java.lang.String prefix, EncryptionKey encryptionKey) throws StorjException
This function is useful for overriding the encryption key in user-specific access grants when implementing multitenancy in a single app bucket.
bucket
- the bucket nameprefix
- the prefixencryptionKey
- new encryption keyStorjException
- in case of error