public class

SimpleAmazonS3AmazonDevKitImpl

extends Object
implements SimpleAmazonS3
java.lang.Object
   ↳ org.mule.module.s3.simpleapi.SimpleAmazonS3AmazonDevKitImpl

Summary

Fields
private final AmazonS3 s3
Public Constructors
SimpleAmazonS3AmazonDevKitImpl(AmazonS3 s3)
Public Methods
String copyObject(S3ObjectId source, S3ObjectId destination, ConditionalConstraints conditionalConstraints, CannedAccessControlList acl, StorageClass storageClass, String encryption, Map<String, String> userMetadata)
Copies a source object, with optional version, to a destination, with optional destination object acl.
Bucket createBucket(String bucketName, Region region, CannedAccessControlList acl)
Creates a Bucket.
String createObject(S3ObjectId objectId, SimpleAmazonS3.S3ObjectContent content, String contentType, String contentDisposition, CannedAccessControlList acl, StorageClass storageClass, String encryption, Map<String, String> userMetadata)
URI createObjectPresignedUri(S3ObjectId objectId, Date expiration, HttpMethod method)
Creates a presigned URL for accessing the object of the given id, with an optional http method and date expiration.
URI createObjectUri(S3ObjectId objectId, boolean secure)
URI createObjectUriUsingDefaultServer(S3ObjectId objectId, boolean secure)
void deleteBucket(String bucketName)
Deletes a Bucket
void deleteBucketAndObjects(String bucketName)
Deletes a Bucket, deleting also all its contents if necessary
void deleteBucketPolicy(String bucketName)
void deleteBucketWebsiteConfiguration(String bucketName)
void deleteObject(S3ObjectId objectId)
Deletes an object.
void deleteObjects(String bucketName, List<KeyVersion> keys)
Deletes all objects
String getBucketPolicy(String bucketName)
Answers the bucket policy, or null, if not set .
BucketVersioningConfiguration getBucketVersioningConfiguration(String bucketName)
Returns the bucket versioning configuration for the specified bucket.
BucketWebsiteConfiguration getBucketWebsiteConfiguration(String bucketName)
Returns the versioning configuration for the specified bucket.
S3Object getObject(S3ObjectId objectId, ConditionalConstraints conditionalConstraints)
Retrieves an object from S3 given its id.
S3ObjectInputStream getObjectContent(S3ObjectId objectId, ConditionalConstraints conditionalConstraints)
Answers the object content a given S3ObjectId.
ObjectMetadata getObjectMetadata(S3ObjectId objectId)
Answers the ObjectMetadata for a given S3ObjectId@return
List<Bucket> listBuckets()
SimpleAmazonS3AmazonDevKitImpl.S3VersionSummaryIterable listObjectVersions(String bucketName)
Iterable<S3ObjectSummary> listObjects(String bucketName, String prefix)
void setBucketPolicy(String bucketName, String policyText)
void setBucketVersioningStatus(String bucketName, VersioningStatus versioningStatus)
void setBucketWebsiteConfiguration(String bucketName, BucketWebsiteConfiguration configuration)
Sets the website configuration for the specified bucket.
void setObjectStorageClass(S3ObjectId objectId, StorageClass newStorageClass)
[Expand]
Inherited Methods
From class java.lang.Object
From interface org.mule.module.s3.simpleapi.SimpleAmazonS3

Fields

private final AmazonS3 s3

Public Constructors

public SimpleAmazonS3AmazonDevKitImpl (AmazonS3 s3)

Parameters
s3

Public Methods

public String copyObject (S3ObjectId source, S3ObjectId destination, ConditionalConstraints conditionalConstraints, CannedAccessControlList acl, StorageClass storageClass, String encryption, Map<String, String> userMetadata)

Copies a source object, with optional version, to a destination, with optional destination object acl.

Parameters
source
destination The destination object. If this id is versioned, its version is ignored
conditionalConstraints The constraints to be matched in order to proceed with copy. If not matched, no copy is performed
acl
storageClass
encryption Encryption for the object. Supported value AES256
userMetadata
Returns
  • the version id of the destination object, if versioning is enabled

public Bucket createBucket (String bucketName, Region region, CannedAccessControlList acl)

Creates a Bucket.

Parameters
bucketName Mandatory
region Optional
acl Optional
Returns
  • the new Bucket

public String createObject (S3ObjectId objectId, SimpleAmazonS3.S3ObjectContent content, String contentType, String contentDisposition, CannedAccessControlList acl, StorageClass storageClass, String encryption, Map<String, String> userMetadata)

Parameters
objectId
content
contentType
contentDisposition
acl
storageClass
encryption
userMetadata

public URI createObjectPresignedUri (S3ObjectId objectId, Date expiration, HttpMethod method)

Creates a presigned URL for accessing the object of the given id, with an optional http method and date expiration.

Parameters
objectId
expiration If no expiration is supplied, a default expiration provided by AmazonS3 will be used
method If no method is supplied, PUT method is assumed

public URI createObjectUri (S3ObjectId objectId, boolean secure)

Parameters
objectId
secure

public URI createObjectUriUsingDefaultServer (S3ObjectId objectId, boolean secure)

Parameters
objectId
secure

public void deleteBucket (String bucketName)

Deletes a Bucket

Parameters
bucketName

public void deleteBucketAndObjects (String bucketName)

Deletes a Bucket, deleting also all its contents if necessary

Parameters
bucketName

public void deleteBucketPolicy (String bucketName)

Parameters
bucketName

public void deleteBucketWebsiteConfiguration (String bucketName)

Parameters
bucketName

public void deleteObject (S3ObjectId objectId)

Deletes an object.

Parameters
objectId

public void deleteObjects (String bucketName, List<KeyVersion> keys)

Deletes all objects

Parameters
bucketName Mandatory bucket name
keys Keys to delete, with optional version

public String getBucketPolicy (String bucketName)

Answers the bucket policy, or null, if not set .

Parameters
bucketName
Returns
  • the nullable bucket policy text

public BucketVersioningConfiguration getBucketVersioningConfiguration (String bucketName)

Returns the bucket versioning configuration for the specified bucket.

Parameters
bucketName The bucket versioning configuration for the specified bucket.
Returns
  • The bucket versioning configuration for the specified bucket.

public BucketWebsiteConfiguration getBucketWebsiteConfiguration (String bucketName)

Returns the versioning configuration for the specified bucket.

Parameters
bucketName The bucket whose versioning configuration will be retrieved.
Returns
  • The bucket versioning configuration for the specified bucket.

public S3Object getObject (S3ObjectId objectId, ConditionalConstraints conditionalConstraints)

Retrieves an object from S3 given its id. Warning: use this method with caution, as the retrieved object has an already open inputStream to the object contents. It should be closed quickly.

Parameters
objectId
conditionalConstraints
Returns
  • the object, or null, if conditional request constraints were not met

public S3ObjectInputStream getObjectContent (S3ObjectId objectId, ConditionalConstraints conditionalConstraints)

Answers the object content a given S3ObjectId.

Parameters
objectId
conditionalConstraints
Returns
  • an input stream to the contents of the object, or null, if there conditional request contraints were not met

public ObjectMetadata getObjectMetadata (S3ObjectId objectId)

Answers the ObjectMetadata for a given S3ObjectId@return

Parameters
objectId

public List<Bucket> listBuckets ()

public SimpleAmazonS3AmazonDevKitImpl.S3VersionSummaryIterable listObjectVersions (String bucketName)

Parameters
bucketName

public Iterable<S3ObjectSummary> listObjects (String bucketName, String prefix)

Parameters
bucketName
prefix

public void setBucketPolicy (String bucketName, String policyText)

Parameters
bucketName
policyText

public void setBucketVersioningStatus (String bucketName, VersioningStatus versioningStatus)

Parameters
bucketName
versioningStatus

public void setBucketWebsiteConfiguration (String bucketName, BucketWebsiteConfiguration configuration)

Sets the website configuration for the specified bucket.

Parameters
bucketName
configuration

public void setObjectStorageClass (S3ObjectId objectId, StorageClass newStorageClass)

Parameters
objectId
newStorageClass