@Throws(value=S3ErrorTypeProvider.class) public class BucketOperations extends S3Operations<BucketService>
DEFAULT_CANNED_ACL, NOT_ENCODED, REGION_DEFAULT| Constructor and Description |
|---|
BucketOperations() |
| Modifier and Type | Method and Description |
|---|---|
Bucket |
createBucket(S3Configuration config,
S3Connection connection,
String bucketName,
String region,
CannedAccessControlList acl)
Creates a new bucket; connector must not be configured as anonymous for this operation to succeed.
|
void |
deleteBucket(S3Configuration config,
S3Connection connection,
String bucketName,
boolean force)
Deletes the specified bucket.
|
void |
deleteBucketPolicy(S3Configuration config,
S3Connection connection,
String bucketName)
Deletes the bucket's policy.
|
org.mule.runtime.extension.api.runtime.operation.Result<List<Grant>,AccessControlListAttributes> |
getBucketAcl(S3Configuration config,
S3Connection connection,
String bucketName)
Answers the access control list of the specified bucket.
|
String |
getBucketLocation(S3Configuration config,
S3Connection connection,
String bucketName)
Gets the geographical region where Amazon S3 stores the specified bucket.
|
String |
getBucketPolicy(S3Configuration config,
S3Connection connection,
String bucketName)
Answers the policy for the given bucket.
|
List<Bucket> |
listBuckets(S3Configuration config,
S3Connection connection,
String region)
Answers a list of all Amazon S3 buckets that the authenticated sender of the request owns.
|
void |
setBucketAcl(S3Configuration config,
S3Connection connection,
String bucketName,
Owner owner,
List<Grant> grants)
Set the permissions on an existing bucket using access control lists (ACL)
|
void |
setBucketPolicy(S3Configuration config,
S3Connection connection,
String bucketName,
String policyText)
Sets the bucket's policy, overriding any previously set.
|
public Bucket createBucket(@Config S3Configuration config, @Connection S3Connection connection, String bucketName, @Optional(defaultValue="US_STANDARD") @OfValues(value=RegionValueProvider.class) String region, @DisplayName(value="Canned ACL") @Optional(defaultValue="PRIVATE") CannedAccessControlList acl)
config - Configuration for Amazon S3 connector.connection - Amazon S3 connection instance.bucketName - The bucket to create. It must not exist yet.region - the region where to create the new bucketacl - the access control list of the new bucketpublic void deleteBucket(@Config
S3Configuration config,
@Connection
S3Connection connection,
String bucketName,
@Summary(value="Optional true if the bucket must be deleted even if it is not empty, false if operation should fail in such scenario.") @Optional(defaultValue="false")
boolean force)
config - Configuration for Amazon S3 connector.connection - Amazon S3 connection instance.bucketName - the bucket to deleteforce - optional true if the bucket must be deleted even if it is not empty, false if operation should fail in such scenario.public List<Bucket> listBuckets(@Config S3Configuration config, @Connection S3Connection connection, @Optional @OfValues(value=RegionValueProvider.class) String region)
config - Configuration for Amazon S3 connector.connection - Amazon S3 connection instance.region - the region from where to list the buckets.@MediaType(value="application/plain") public String getBucketLocation(@Config S3Configuration config, @Connection S3Connection connection, String bucketName)
config - Configuration for Amazon S3 connector.connection - Amazon S3 connection instance.bucketName - The target bucket name.@MediaType(value="text/plain") public String getBucketPolicy(@Config S3Configuration config, @Connection S3Connection connection, String bucketName)
config - Configuration for Amazon S3 connector.connection - Amazon S3 connection instance.bucketName - the bucket whose policy to retrievepublic void deleteBucketPolicy(@Config
S3Configuration config,
@Connection
S3Connection connection,
String bucketName)
config - Configuration for Amazon S3 connector.connection - Amazon S3 connection instance.bucketName - the bucket whose policy to deletepublic void setBucketPolicy(@Config
S3Configuration config,
@Connection
S3Connection connection,
String bucketName,
@Content @Text
String policyText)
config - Configuration for Amazon S3 connector.connection - Amazon S3 connection instance.bucketName - the bucket namepolicyText - the policy textpublic org.mule.runtime.extension.api.runtime.operation.Result<List<Grant>,AccessControlListAttributes> getBucketAcl(@Config S3Configuration config, @Connection S3Connection connection, String bucketName)
config - Configuration for Amazon S3 connector.connection - Amazon S3 connection instance.bucketName - the bucket whose acl to retrieve.public void setBucketAcl(@Config
S3Configuration config,
@Connection
S3Connection connection,
String bucketName,
Owner owner,
@Content
List<Grant> grants)
config - Configuration for Amazon S3 connector.connection - Amazon S3 connection instance.bucketName - the bucket nameowner - The owner of the ACL.grants - The grants of the ACL.Copyright © 2021 MuleSoft, Inc.. All rights reserved.