com.amazonaws.services.s3
Class AmazonS3Client

java.lang.Object
  extended by com.amazonaws.AmazonWebServiceClient
      extended by com.amazonaws.services.s3.AmazonS3Client
All Implemented Interfaces:
AmazonS3
Direct Known Subclasses:
AmazonS3EncryptionClient

public class AmazonS3Client
extends AmazonWebServiceClient
implements AmazonS3

Provides the client for accessing the Amazon S3 web service.

Amazon S3 provides storage for the Internet, and is designed to make web-scale computing easier for developers.

The Amazon S3 Java Client provides a simple interface that can be used to store and retrieve any amount of data, at any time, from anywhere on the web. It gives any developer access to the same highly scalable, reliable, secure, fast, inexpensive infrastructure that Amazon uses to run its own global network of web sites. The service aims to maximize benefits of scale and to pass those benefits on to developers.

For more information about Amazon S3, please see http://aws.amazon.com/s3


Field Summary
static String S3_SERVICE_NAME
           
 
Fields inherited from class com.amazonaws.AmazonWebServiceClient
LOGGING_AWS_REQUEST_METRIC
 
Constructor Summary
AmazonS3Client()
          Constructs a new client to invoke service methods on Amazon S3.
AmazonS3Client(AWSCredentials awsCredentials)
          Constructs a new Amazon S3 client using the specified AWS credentials to access Amazon S3.
AmazonS3Client(AWSCredentials awsCredentials, ClientConfiguration clientConfiguration)
          Constructs a new Amazon S3 client using the specified AWS credentials and client configuration to access Amazon S3.
AmazonS3Client(AWSCredentialsProvider credentialsProvider)
          Constructs a new Amazon S3 client using the specified AWS credentials provider to access Amazon S3.
AmazonS3Client(AWSCredentialsProvider credentialsProvider, ClientConfiguration clientConfiguration)
          Constructs a new Amazon S3 client using the specified AWS credentials and client configuration to access Amazon S3.
AmazonS3Client(AWSCredentialsProvider credentialsProvider, ClientConfiguration clientConfiguration, RequestMetricCollector requestMetricCollector)
          Constructs a new Amazon S3 client using the specified AWS credentials, client configuration and request metric collector to access Amazon S3.
AmazonS3Client(ClientConfiguration clientConfiguration)
          Constructs a new client using the specified client configuration to access Amazon S3.
 
Method Summary
 void abortMultipartUpload(AbortMultipartUploadRequest abortMultipartUploadRequest)
          Aborts a multipart upload.
 void changeObjectStorageClass(String bucketName, String key, StorageClass newStorageClass)
           Changes the Amazon S3 storage class for a specified object.
 CompleteMultipartUploadResult completeMultipartUpload(CompleteMultipartUploadRequest completeMultipartUploadRequest)
          Completes a multipart upload by assembling previously uploaded parts.
 CopyObjectResult copyObject(CopyObjectRequest copyObjectRequest)
           Copies a source object to a new destination in Amazon S3.
 CopyObjectResult copyObject(String sourceBucketName, String sourceKey, String destinationBucketName, String destinationKey)
           Copies a source object to a new destination in Amazon S3.
 CopyPartResult copyPart(CopyPartRequest copyPartRequest)
          Copies a source object to a part of a multipart upload.
 Bucket createBucket(CreateBucketRequest createBucketRequest)
           Creates a new Amazon S3 bucket in the default region, Region.US_Standard.
 Bucket createBucket(String bucketName)
           Creates a new Amazon S3 bucket with the specified name in the default (US) region, Region.US_Standard.
 Bucket createBucket(String bucketName, Region region)
           Creates a new Amazon S3 bucket with the specified name in the specified Amazon S3 region.
 Bucket createBucket(String bucketName, String region)
           Creates a new Amazon S3 bucket with the specified name in the specified Amazon S3 region.
 void deleteBucket(DeleteBucketRequest deleteBucketRequest)
           Deletes the specified bucket.
 void deleteBucket(String bucketName)
           Deletes the specified bucket.
 void deleteBucketCrossOriginConfiguration(DeleteBucketCrossOriginConfigurationRequest deleteBucketCrossOriginConfigurationRequest)
          Delete the cross origin configuration for the specified bucket.
 void deleteBucketCrossOriginConfiguration(String bucketName)
          Delete the cross origin configuration for the specified bucket.
 void deleteBucketLifecycleConfiguration(DeleteBucketLifecycleConfigurationRequest deleteBucketLifecycleConfigurationRequest)
          Removes the lifecycle configuration for the bucket specified.
 void deleteBucketLifecycleConfiguration(String bucketName)
          Removes the lifecycle configuration for the bucket specified.
 void deleteBucketPolicy(DeleteBucketPolicyRequest deleteBucketPolicyRequest)
           Deletes the policy associated with the specified bucket.
 void deleteBucketPolicy(String bucketName)
           Deletes the policy associated with the specified bucket.
 void deleteBucketTaggingConfiguration(DeleteBucketTaggingConfigurationRequest deleteBucketTaggingConfigurationRequest)
          Removes the tagging configuration for the bucket specified.
 void deleteBucketTaggingConfiguration(String bucketName)
          Removes the tagging configuration for the bucket specified.
 void deleteBucketWebsiteConfiguration(DeleteBucketWebsiteConfigurationRequest deleteBucketWebsiteConfigurationRequest)
          This operation removes the website configuration for a bucket.
 void deleteBucketWebsiteConfiguration(String bucketName)
          This operation removes the website configuration for a bucket.
 void deleteObject(DeleteObjectRequest deleteObjectRequest)
           Deletes the specified object in the specified bucket.
 void deleteObject(String bucketName, String key)
           Deletes the specified object in the specified bucket.
 DeleteObjectsResult deleteObjects(DeleteObjectsRequest deleteObjectsRequest)
          Deletes multiple objects in a single bucket from S3.
 void deleteVersion(DeleteVersionRequest deleteVersionRequest)
           Deletes a specific version of an object in the specified bucket.
 void deleteVersion(String bucketName, String key, String versionId)
           Deletes a specific version of the specified object in the specified bucket.
 void disableRequesterPays(String bucketName)
          Allows Amazon S3 bucket owner to disable the Requester Pays for the given bucket name.
 boolean doesBucketExist(String bucketName)
          Checks if the specified bucket exists.
 void enableRequesterPays(String bucketName)
          Allows Amazon S3 bucket owner to enable the Requester Pays for the given bucket name.
 URL generatePresignedUrl(GeneratePresignedUrlRequest generatePresignedUrlRequest)
           Returns a pre-signed URL for accessing an Amazon S3 resource.
 URL generatePresignedUrl(String bucketName, String key, Date expiration)
           Returns a pre-signed URL for accessing an Amazon S3 resource.
 URL generatePresignedUrl(String bucketName, String key, Date expiration, HttpMethod method)
           Returns a pre-signed URL for accessing an Amazon S3 resource.
 AccessControlList getBucketAcl(GetBucketAclRequest getBucketAclRequest)
          Gets the AccessControlList (ACL) for the specified Amazon S3 bucket.
 AccessControlList getBucketAcl(String bucketName)
           Gets the AccessControlList (ACL) for the specified Amazon S3 bucket.
 BucketCrossOriginConfiguration getBucketCrossOriginConfiguration(String bucketName)
          Gets the cross origin configuration for the specified bucket, or null if no configuration has been established.
 BucketLifecycleConfiguration getBucketLifecycleConfiguration(String bucketName)
          Gets the lifecycle configuration for the specified bucket, or null if no configuration has been established.
 String getBucketLocation(GetBucketLocationRequest getBucketLocationRequest)
           Gets the geographical region where Amazon S3 stores the specified bucket.
 String getBucketLocation(String bucketName)
           Gets the geographical region where Amazon S3 stores the specified bucket.
 BucketLoggingConfiguration getBucketLoggingConfiguration(String bucketName)
           Gets the logging configuration for the specified bucket.
 BucketNotificationConfiguration getBucketNotificationConfiguration(String bucketName)
          Gets the notification configuration for the specified bucket.
 BucketPolicy getBucketPolicy(GetBucketPolicyRequest getBucketPolicyRequest)
           Gets the policy for the specified bucket.
 BucketPolicy getBucketPolicy(String bucketName)
           Gets the policy for the specified bucket.
 BucketTaggingConfiguration getBucketTaggingConfiguration(String bucketName)
          Gets the tagging configuration for the specified bucket, or null if no configuration has been established.
 BucketVersioningConfiguration getBucketVersioningConfiguration(String bucketName)
           Returns the versioning configuration for the specified bucket.
 BucketWebsiteConfiguration getBucketWebsiteConfiguration(GetBucketWebsiteConfigurationRequest getBucketWebsiteConfigurationRequest)
          Returns the website configuration for the specified bucket.
 BucketWebsiteConfiguration getBucketWebsiteConfiguration(String bucketName)
          Returns the website configuration for the specified bucket.
 S3ResponseMetadata getCachedResponseMetadata(AmazonWebServiceRequest request)
          Gets additional metadata for a previously executed successful request.
 S3Object getObject(GetObjectRequest getObjectRequest)
           Gets the object stored in Amazon S3 under the specified bucket and key.
 ObjectMetadata getObject(GetObjectRequest getObjectRequest, File destinationFile)
           Gets the object metadata for the object stored in Amazon S3 under the specified bucket and key, and saves the object contents to the specified file.
 S3Object getObject(String bucketName, String key)
           Gets the object stored in Amazon S3 under the specified bucket and key.
 AccessControlList getObjectAcl(String bucketName, String key)
           Gets the AccessControlList (ACL) for the specified object in Amazon S3.
 AccessControlList getObjectAcl(String bucketName, String key, String versionId)
           Gets the AccessControlList (ACL) for the specified object with the specified version in Amazon S3.
 ObjectMetadata getObjectMetadata(GetObjectMetadataRequest getObjectMetadataRequest)
           Gets the metadata for the specified Amazon S3 object without actually fetching the object itself.
 ObjectMetadata getObjectMetadata(String bucketName, String key)
           Gets the metadata for the specified Amazon S3 object without actually fetching the object itself.
 Region getRegion()
           
 String getResourceUrl(String bucketName, String key)
          Returns the URL to the key in the bucket given, using the client's scheme and endpoint.
 Owner getS3AccountOwner()
           Gets the current owner of the AWS account that the authenticated sender of the request is using.
 URL getUrl(String bucketName, String key)
          Returns an URL for the object stored in the specified bucket and key.
 InitiateMultipartUploadResult initiateMultipartUpload(InitiateMultipartUploadRequest initiateMultipartUploadRequest)
          Initiates a multipart upload and returns an InitiateMultipartUploadResult which contains an upload ID.
 boolean isRequesterPaysEnabled(String bucketName)
          Retrieves the Requester Pays configuration associated with an Amazon S3 bucket.
 List<Bucket> listBuckets()
           Returns a list of all Amazon S3 buckets that the authenticated sender of the request owns.
 List<Bucket> listBuckets(ListBucketsRequest listBucketsRequest)
           Returns a list of all Amazon S3 buckets that the authenticated sender of the request owns.
 MultipartUploadListing listMultipartUploads(ListMultipartUploadsRequest listMultipartUploadsRequest)
          Lists in-progress multipart uploads.
 ObjectListing listNextBatchOfObjects(ObjectListing previousObjectListing)
           Provides an easy way to continue a truncated object listing and retrieve the next page of results.
 VersionListing listNextBatchOfVersions(VersionListing previousVersionListing)
           Provides an easy way to continue a truncated VersionListing and retrieve the next page of results.
 ObjectListing listObjects(ListObjectsRequest listObjectsRequest)
           Returns a list of summary information about the objects in the specified bucket.
 ObjectListing listObjects(String bucketName)
           Returns a list of summary information about the objects in the specified buckets.
 ObjectListing listObjects(String bucketName, String prefix)
           Returns a list of summary information about the objects in the specified bucket.
 PartListing listParts(ListPartsRequest listPartsRequest)
          Lists the parts that have been uploaded for a specific multipart upload.
 VersionListing listVersions(ListVersionsRequest listVersionsRequest)
           Returns a list of summary information about the versions in the specified bucket.
 VersionListing listVersions(String bucketName, String prefix)
           Returns a list of summary information about the versions in the specified bucket.
 VersionListing listVersions(String bucketName, String prefix, String keyMarker, String versionIdMarker, String delimiter, Integer maxKeys)
           Returns a list of summary information about the versions in the specified bucket.
 PutObjectResult putObject(PutObjectRequest putObjectRequest)
           Uploads a new object to the specified Amazon S3 bucket.
 PutObjectResult putObject(String bucketName, String key, File file)
           Uploads the specified file to Amazon S3 under the specified bucket and key name.
 PutObjectResult putObject(String bucketName, String key, InputStream input, ObjectMetadata metadata)
           Uploads the specified input stream and object metadata to Amazon S3 under the specified bucket and key name.
 void restoreObject(RestoreObjectRequest restoreObjectRequest)
          Restore an object, which was transitioned to Amazon Glacier from Amazon S3 when it was expired, into Amazon S3 again.
 void restoreObject(String bucketName, String key, int expirationInDays)
          (non-Javadoc)
 void setBucketAcl(SetBucketAclRequest setBucketAclRequest)
          Sets the AccessControlList for the specified Amazon S3 bucket.
 void setBucketAcl(String bucketName, AccessControlList acl)
           Sets the AccessControlList for the specified Amazon S3 bucket.
 void setBucketAcl(String bucketName, AccessControlList acl, RequestMetricCollector requestMetricCollector)
          Same as setBucketAcl(String, AccessControlList) but allows specifying a request metric collector.
 void setBucketAcl(String bucketName, CannedAccessControlList acl)
           Sets the CannedAccessControlList for the specified Amazon S3 bucket using one of the pre-configured CannedAccessControlLists.
 void setBucketAcl(String bucketName, CannedAccessControlList acl, RequestMetricCollector requestMetricCollector)
          Same as setBucketAcl(String, CannedAccessControlList) but allows specifying a request metric collector.
 void setBucketCrossOriginConfiguration(SetBucketCrossOriginConfigurationRequest setBucketCrossOriginConfigurationRequest)
          Sets the cross origin configuration for the specified bucket.
 void setBucketCrossOriginConfiguration(String bucketName, BucketCrossOriginConfiguration bucketCrossOriginConfiguration)
          Sets the cross origin configuration for the specified bucket.
 void setBucketLifecycleConfiguration(SetBucketLifecycleConfigurationRequest setBucketLifecycleConfigurationRequest)
          Sets the lifecycle configuration for the specified bucket.
 void setBucketLifecycleConfiguration(String bucketName, BucketLifecycleConfiguration bucketLifecycleConfiguration)
          Sets the lifecycle configuration for the specified bucket.
 void setBucketLoggingConfiguration(SetBucketLoggingConfigurationRequest setBucketLoggingConfigurationRequest)
           Sets the logging configuration for the specified bucket.
 void setBucketNotificationConfiguration(SetBucketNotificationConfigurationRequest setBucketNotificationConfigurationRequest)
          Sets the notification configuration for the specified bucket.
 void setBucketNotificationConfiguration(String bucketName, BucketNotificationConfiguration bucketNotificationConfiguration)
          Sets the notification configuration for the specified bucket.
 void setBucketPolicy(SetBucketPolicyRequest setBucketPolicyRequest)
           Sets the policy associated with the specified bucket.
 void setBucketPolicy(String bucketName, String policyText)
           Sets the policy associated with the specified bucket.
 void setBucketTaggingConfiguration(SetBucketTaggingConfigurationRequest setBucketTaggingConfigurationRequest)
          Sets the tagging configuration for the specified bucket.
 void setBucketTaggingConfiguration(String bucketName, BucketTaggingConfiguration bucketTaggingConfiguration)
          Sets the tagging configuration for the specified bucket.
 void setBucketVersioningConfiguration(SetBucketVersioningConfigurationRequest setBucketVersioningConfigurationRequest)
           Sets the versioning configuration for the specified bucket.
 void setBucketWebsiteConfiguration(SetBucketWebsiteConfigurationRequest setBucketWebsiteConfigurationRequest)
          Sets the website configuration for the specified bucket.
 void setBucketWebsiteConfiguration(String bucketName, BucketWebsiteConfiguration configuration)
          Sets the website configuration for the specified bucket.
 void setEndpoint(String endpoint)
          Overrides the default endpoint for this client.
 void setObjectAcl(String bucketName, String key, AccessControlList acl)
           Sets the AccessControlList for the specified object in Amazon S3.
 void setObjectAcl(String bucketName, String key, CannedAccessControlList acl)
           Sets the CannedAccessControlList for the specified object in Amazon S3 using one of the pre-configured CannedAccessControlLists.
 void setObjectAcl(String bucketName, String key, String versionId, AccessControlList acl)
           Sets the CannedAccessControlList for the specified object with the specified version in Amazon S3.
 void setObjectAcl(String bucketName, String key, String versionId, AccessControlList acl, RequestMetricCollector requestMetricCollector)
          Same as setObjectAcl(String, String, String, AccessControlList) but allows specifying a request metric collector.
 void setObjectAcl(String bucketName, String key, String versionId, CannedAccessControlList acl)
           Sets the CannedAccessControlList for the specified object with the specified version ID in Amazon S3 using one of the pre-configured CannedAccessControlLists.
 void setObjectAcl(String bucketName, String key, String versionId, CannedAccessControlList acl, RequestMetricCollector requestMetricCollector)
          Same as setObjectAcl(String, String, String, CannedAccessControlList) but allows specifying a request metric collector.
 void setObjectRedirectLocation(String bucketName, String key, String newRedirectLocation)
           Changes the Amazon S3 redirect location for a specific object.
 void setRegion(Region region)
          An alternative to AmazonWebServiceClient.setEndpoint(String), sets the regional endpoint for this client's service calls.
 void setS3ClientOptions(S3ClientOptions clientOptions)
           Override the default S3 client options for this client.
 UploadPartResult uploadPart(UploadPartRequest uploadPartRequest)
          Uploads a part in a multipart upload.
 
Methods inherited from class com.amazonaws.AmazonWebServiceClient
addRequestHandler, addRequestHandler, getRequestMetricsCollector, getServiceName, getSignerByURI, getSignerRegionOverride, getTimeOffset, removeRequestHandler, removeRequestHandler, setConfiguration, setEndpoint, setServiceNameIntern, setSignerRegionOverride, setTimeOffset, shutdown, withTimeOffset
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

S3_SERVICE_NAME

public static final String S3_SERVICE_NAME
See Also:
Constant Field Values
Constructor Detail

AmazonS3Client

public AmazonS3Client()
Constructs a new client to invoke service methods on Amazon S3. A credentials provider chain will be used that searches for credentials in this order:

If no credentials are found in the chain, this client will attempt to work in an anonymous mode where requests aren't signed. Only a subset of the Amazon S3 API will work with anonymous (i.e. unsigned) requests, but this can prove useful in some situations. For example:

You can force the client to operate in an anonymous mode, and skip the credentials provider chain, by passing in null for the credentials.

See Also:
AmazonS3Client(AWSCredentials), AmazonS3Client(AWSCredentials, ClientConfiguration)

AmazonS3Client

public AmazonS3Client(AWSCredentials awsCredentials)
Constructs a new Amazon S3 client using the specified AWS credentials to access Amazon S3.

Parameters:
awsCredentials - The AWS credentials to use when making requests to Amazon S3 with this client.
See Also:
AmazonS3Client(), AmazonS3Client(AWSCredentials, ClientConfiguration)

AmazonS3Client

public AmazonS3Client(AWSCredentials awsCredentials,
                      ClientConfiguration clientConfiguration)
Constructs a new Amazon S3 client using the specified AWS credentials and client configuration to access Amazon S3.

Parameters:
awsCredentials - The AWS credentials to use when making requests to Amazon S3 with this client.
clientConfiguration - The client configuration options controlling how this client connects to Amazon S3 (e.g. proxy settings, retry counts, etc).
See Also:
AmazonS3Client(), AmazonS3Client(AWSCredentials)

AmazonS3Client

public AmazonS3Client(AWSCredentialsProvider credentialsProvider)
Constructs a new Amazon S3 client using the specified AWS credentials provider to access Amazon S3.

Parameters:
credentialsProvider - The AWS credentials provider which will provide credentials to authenticate requests with AWS services.

AmazonS3Client

public AmazonS3Client(AWSCredentialsProvider credentialsProvider,
                      ClientConfiguration clientConfiguration)
Constructs a new Amazon S3 client using the specified AWS credentials and client configuration to access Amazon S3.

Parameters:
credentialsProvider - The AWS credentials provider which will provide credentials to authenticate requests with AWS services.
clientConfiguration - The client configuration options controlling how this client connects to Amazon S3 (e.g. proxy settings, retry counts, etc).

AmazonS3Client

public AmazonS3Client(AWSCredentialsProvider credentialsProvider,
                      ClientConfiguration clientConfiguration,
                      RequestMetricCollector requestMetricCollector)
Constructs a new Amazon S3 client using the specified AWS credentials, client configuration and request metric collector to access Amazon S3.

Parameters:
credentialsProvider - The AWS credentials provider which will provide credentials to authenticate requests with AWS services.
clientConfiguration - The client configuration options controlling how this client connects to Amazon S3 (e.g. proxy settings, retry counts, etc).
requestMetricCollector - request metric collector

AmazonS3Client

public AmazonS3Client(ClientConfiguration clientConfiguration)
Constructs a new client using the specified client configuration to access Amazon S3. A credentials provider chain will be used that searches for credentials in this order:

If no credentials are found in the chain, this client will attempt to work in an anonymous mode where requests aren't signed. Only a subset of the Amazon S3 API will work with anonymous (i.e. unsigned) requests, but this can prove useful in some situations. For example:

You can force the client to operate in an anonymous mode, and skip the credentials provider chain, by passing in null for the credentials.

Parameters:
clientConfiguration - The client configuration options controlling how this client connects to Amazon S3 (e.g. proxy settings, retry counts, etc).
See Also:
AmazonS3Client(AWSCredentials), AmazonS3Client(AWSCredentials, ClientConfiguration)
Method Detail

setEndpoint

public void setEndpoint(String endpoint)
Description copied from class: AmazonWebServiceClient
Overrides the default endpoint for this client. Callers can use this method to control which AWS region they want to work with.

This method is not threadsafe. Endpoints should be configured when the client is created and before any service requests are made. Changing it afterwards creates inevitable race conditions for any service requests in transit.

Callers can pass in just the endpoint (ex: "ec2.amazonaws.com") or a full URL, including the protocol (ex: "https://ec2.amazonaws.com"). If the protocol is not specified here, the default protocol from this client's ClientConfiguration will be used, which by default is HTTPS.

For more information on using AWS regions with the AWS SDK for Java, and a complete list of all available endpoints for all AWS services, see: http://developer.amazonwebservices.com/connect/entry.jspa?externalID=3912

Specified by:
setEndpoint in interface AmazonS3
Overrides:
setEndpoint in class AmazonWebServiceClient
Parameters:
endpoint - The endpoint (ex: "ec2.amazonaws.com") or a full URL, including the protocol (ex: "https://ec2.amazonaws.com") of the region specific AWS endpoint this client will communicate with.

setRegion

public void setRegion(Region region)
Description copied from class: AmazonWebServiceClient
An alternative to AmazonWebServiceClient.setEndpoint(String), sets the regional endpoint for this client's service calls. Callers can use this method to control which AWS region they want to work with.

This method is not threadsafe. A region should be configured when the client is created and before any service requests are made. Changing it afterwards creates inevitable race conditions for any service requests in transit or retrying.

By default, all service endpoints in all regions use the https protocol. To use http instead, specify it in the ClientConfiguration supplied at construction.

Specified by:
setRegion in interface AmazonS3
Overrides:
setRegion in class AmazonWebServiceClient
Parameters:
region - The region this client will communicate with. See Region.getRegion(com.amazonaws.regions.Regions) for accessing a given region.
See Also:
Region.getRegion(com.amazonaws.regions.Regions), Region.createClient(Class, com.amazonaws.auth.AWSCredentialsProvider, ClientConfiguration)

setS3ClientOptions

public void setS3ClientOptions(S3ClientOptions clientOptions)

Override the default S3 client options for this client.

Specified by:
setS3ClientOptions in interface AmazonS3
Parameters:
clientOptions - The S3 client options to use.

listNextBatchOfVersions

public VersionListing listNextBatchOfVersions(VersionListing previousVersionListing)
                                       throws AmazonClientException,
                                              AmazonServiceException
Description copied from interface: AmazonS3

Provides an easy way to continue a truncated VersionListing and retrieve the next page of results.

Obtain the initial VersionListing from one of the listVersions methods. If the result is truncated (indicated when ObjectListing.isTruncated() returns true), pass the VersionListing back into this method in order to retrieve the next page of results. From there, continue using this method to retrieve more results until the returned VersionListing indicates that it is not truncated.

For more information about enabling versioning for a bucket, see AmazonS3.setBucketVersioningConfiguration(SetBucketVersioningConfigurationRequest).

Specified by:
listNextBatchOfVersions in interface AmazonS3
Parameters:
previousVersionListing - The previous truncated VersionListing. If a non-truncated VersionListing is passed in, an empty VersionListing is returned without ever contacting Amazon S3.
Returns:
The next set of VersionListing results, beginning immediately after the last result in the specified previous VersionListing.
Throws:
AmazonClientException - If any errors are encountered in the client while making the request or handling the response.
AmazonServiceException - If any errors occurred in Amazon S3 while processing the request.
See Also:
listVersions(String, String), listVersions(ListVersionsRequest), listVersions(String, String, String, String, String, Integer)

listVersions

public VersionListing listVersions(String bucketName,
                                   String prefix)
                            throws AmazonClientException,
                                   AmazonServiceException
Description copied from interface: AmazonS3

Returns a list of summary information about the versions in the specified bucket.

The returned version summaries are ordered first by key and then by version. Keys are sorted lexicographically (alphabetically) while versions are sorted from most recent to least recent. Both versions with data and delete markers are included in the results.

Because buckets can contain a virtually unlimited number of versions, the complete results of a list query can be extremely large. To manage large result sets, Amazon S3 uses pagination to split them into multiple responses. Always check the VersionListing.isTruncated() method to determine if the returned listing is complete or if additional calls are needed to get more results. Callers are encouraged to use AmazonS3.listNextBatchOfVersions(VersionListing) as an easy way to get the next page of results.

For more information about enabling versioning for a bucket, see AmazonS3.setBucketVersioningConfiguration(SetBucketVersioningConfigurationRequest).

Specified by:
listVersions in interface AmazonS3
Parameters:
bucketName - The name of the Amazon S3 bucket whose versions are to be listed.
prefix - An optional parameter restricting the response to keys beginning with the specified prefix. Use prefixes to separate a bucket into different sets of keys, similar to how a file system organizes files into directories.
Returns:
A listing of the versions in the specified bucket, along with any other associated information and original request parameters.
Throws:
AmazonClientException - If any errors are encountered in the client while making the request or handling the response.
AmazonServiceException - If any errors occurred in Amazon S3 while processing the request.
See Also:
listVersions(ListVersionsRequest), listVersions(String, String, String, String, String, Integer)

listVersions

public VersionListing listVersions(String bucketName,
                                   String prefix,
                                   String keyMarker,
                                   String versionIdMarker,
                                   String delimiter,
                                   Integer maxKeys)
                            throws AmazonClientException,
                                   AmazonServiceException
Description copied from interface: AmazonS3

Returns a list of summary information about the versions in the specified bucket.

The returned version summaries are ordered first by key and then by version. Keys are sorted lexicographically (alphabetically) and versions are sorted from most recent to least recent. Versions with data and delete markers are included in the results.

Because buckets can contain a virtually unlimited number of versions, the complete results of a list query can be extremely large. To manage large result sets, Amazon S3 uses pagination to split them into multiple responses. Always check the VersionListing.isTruncated() method to determine if the returned listing is complete or if additional calls are needed to get more results. Callers are encouraged to use AmazonS3.listNextBatchOfVersions(VersionListing) as an easy way to get the next page of results.

The keyMarker and versionIdMarker parameters allow callers to specify where to start the version listing.

The delimiter parameter allows groups of keys that share a delimiter-terminated prefix to be included in the returned listing. This allows applications to organize and browse their keys hierarchically, much like how a file system organizes files into directories. These common prefixes can be retrieved by calling the VersionListing.getCommonPrefixes() method.

For example, consider a bucket that contains the following keys:

If calling listVersions with a prefix value of "foo/" and a delimiter value of "/" on this bucket, a VersionListing is returned that contains:

To see deeper into the virtual hierarchy, make another call to listVersions setting the prefix parameter to any interesting common prefix to list the individual versions under that prefix.

For more information about enabling versioning for a bucket, see AmazonS3.setBucketVersioningConfiguration(SetBucketVersioningConfigurationRequest).

Specified by:
listVersions in interface AmazonS3
Parameters:
bucketName - The name of the Amazon S3 bucket whose versions are to be listed.
prefix - An optional parameter restricting the response to keys that begin with the specified prefix. Use prefixes to separate a bucket into different sets of keys, similar to how a file system organizes files into directories.
keyMarker - Optional parameter indicating where in the sorted list of all versions in the specified bucket to begin returning results. Results are always ordered first lexicographically (i.e. alphabetically) and then from most recent version to least recent version. If a keyMarker is used without a versionIdMarker, results begin immediately after that key's last version. When a keyMarker is used with a versionIdMarker, results begin immediately after the version with the specified key and version ID.

This enables pagination; to get the next page of results use the next key marker and next version ID marker (from VersionListing.getNextKeyMarker() and VersionListing.getNextVersionIdMarker()) as the markers for the next request to list versions, or use the convenience method AmazonS3.listNextBatchOfVersions(VersionListing)

versionIdMarker - Optional parameter indicating where in the sorted list of all versions in the specified bucket to begin returning results. Results are always ordered first lexicographically (i.e. alphabetically) and then from most recent version to least recent version. A keyMarker must be specified when specifying a versionIdMarker. Results begin immediately after the version with the specified key and version ID.

This enables pagination; to get the next page of results use the next key marker and next version ID marker (from VersionListing.getNextKeyMarker() and VersionListing.getNextVersionIdMarker()) as the markers for the next request to list versions, or use the convenience method AmazonS3.listNextBatchOfVersions(VersionListing)

delimiter - Optional parameter that causes keys that contain the same string between the prefix and the first occurrence of the delimiter to be rolled up into a single result element in the VersionListing.getCommonPrefixes() list. These rolled-up keys are not returned elsewhere in the response. The most commonly used delimiter is "/", which simulates a hierarchical organization similar to a file system directory structure.
maxKeys - Optional parameter indicating the maximum number of results to include in the response. Amazon S3 might return fewer than this, but will not return more. Even if maxKeys is not specified, Amazon S3 will limit the number of results in the response.
Returns:
A listing of the versions in the specified bucket, along with any other associated information such as common prefixes (if a delimiter was specified), the original request parameters, etc.
Throws:
AmazonClientException - If any errors are encountered in the client while making the request or handling the response.
AmazonServiceException - If any errors occurred in Amazon S3 while processing the request.
See Also:
listVersions(String, String), listVersions(ListVersionsRequest), listNextBatchOfVersions(VersionListing)

listVersions

public VersionListing listVersions(ListVersionsRequest listVersionsRequest)
                            throws AmazonClientException,
                                   AmazonServiceException
Description copied from interface: AmazonS3

Returns a list of summary information about the versions in the specified bucket.

The returned version summaries are ordered first by key and then by version. Keys are sorted lexicographically (alphabetically) and versions are sorted from most recent to least recent. Versions with data and delete markers are included in the results.

Because buckets can contain a virtually unlimited number of versions, the complete results of a list query can be extremely large. To manage large result sets, Amazon S3 uses pagination to split them into multiple responses. Always check the VersionListing.isTruncated() method to determine if the returned listing is complete or if additional calls are needed to get more results. Callers are encouraged to use AmazonS3.listNextBatchOfVersions(VersionListing) as an easy way to get the next page of results.

The keyMarker and versionIdMarker parameters allow callers to specify where to start the version listing.

The delimiter parameter allows groups of keys that share a delimiter-terminated prefix to be included in the returned listing. This allows applications to organize and browse their keys hierarchically, much like how a file system organizes files into directories. These common prefixes can be retrieved by calling the VersionListing.getCommonPrefixes() method.

For example, consider a bucket that contains the following keys:

If calling listVersions with a prefix value of "foo/" and a delimiter value of "/" on this bucket, a VersionListing is returned that contains:

To see deeper into the virtual hierarchy, make another call to listVersions setting the prefix parameter to any interesting common prefix to list the individual versions under that prefix.

For more information about enabling versioning for a bucket, see AmazonS3.setBucketVersioningConfiguration(SetBucketVersioningConfigurationRequest).

Specified by:
listVersions in interface AmazonS3
Parameters:
listVersionsRequest - The request object containing all options for listing the versions in a specified bucket.
Returns:
A listing of the versions in the specified bucket, along with any other associated information such as common prefixes (if a delimiter was specified), the original request parameters, etc.
Throws:
AmazonClientException - If any errors are encountered in the client while making the request or handling the response.
AmazonServiceException - If any errors occurred in Amazon S3 while processing the request.
See Also:
listVersions(String, String), listVersions(String, String, String, String, String, Integer), listNextBatchOfVersions(VersionListing)

listObjects

public ObjectListing listObjects(String bucketName)
                          throws AmazonClientException,
                                 AmazonServiceException
Description copied from interface: AmazonS3

Returns a list of summary information about the objects in the specified buckets. List results are always returned in lexicographic (alphabetical) order.

Because buckets can contain a virtually unlimited number of keys, the complete results of a list query can be extremely large. To manage large result sets, Amazon S3 uses pagination to split them into multiple responses. Always check the ObjectListing.isTruncated() method to see if the returned listing is complete or if additional calls are needed to get more results. Alternatively, use the listNextBatchOfObjects(ObjectListing) method as an easy way to get the next page of object listings.

The total number of keys in a bucket doesn't substantially affect list performance.

Specified by:
listObjects in interface AmazonS3
Parameters:
bucketName - The name of the Amazon S3 bucket to list.
Returns:
A listing of the objects in the specified bucket, along with any other associated information, such as common prefixes (if a delimiter was specified), the original request parameters, etc.
Throws:
AmazonClientException - If any errors are encountered in the client while making the request or handling the response.
AmazonServiceException - If any errors occurred in Amazon S3 while processing the request.
See Also:
listObjects(String, String), listObjects(ListObjectsRequest)

listObjects

public ObjectListing listObjects(String bucketName,
                                 String prefix)
                          throws AmazonClientException,
                                 AmazonServiceException
Description copied from interface: AmazonS3

Returns a list of summary information about the objects in the specified bucket. Depending on request parameters, additional information is returned, such as common prefixes if a delimiter was specified. List results are always returned in lexicographic (alphabetical) order.

Because buckets can contain a virtually unlimited number of keys, the complete results of a list query can be extremely large. To manage large result sets, Amazon S3 uses pagination to split them into multiple responses. Always check the ObjectListing.isTruncated() method to see if the returned listing is complete or if additional calls are needed to get more results. Alternatively, use the listNextBatchOfObjects(ObjectListing) method as an easy way to get the next page of object listings.

For example, consider a bucket that contains the following keys:

If calling listObjects with a prefix value of "foo/" and a delimiter value of "/" on this bucket, an ObjectListing is returned that contains one key ("foo/boo") and one entry in the common prefixes list ("foo/bar/"). To see deeper into the virtual hierarchy, make another call to listObjects setting the prefix parameter to any interesting common prefix to list the individual keys under that prefix.

The total number of keys in a bucket doesn't substantially affect list performance.

Specified by:
listObjects in interface AmazonS3
Parameters:
bucketName - The name of the Amazon S3 bucket to list.
prefix - An optional parameter restricting the response to keys beginning with the specified prefix. Use prefixes to separate a bucket into different sets of keys, similar to how a file system organizes files into directories.
Returns:
A listing of the objects in the specified bucket, along with any other associated information, such as common prefixes (if a delimiter was specified), the original request parameters, etc.
Throws:
AmazonClientException - If any errors are encountered in the client while making the request or handling the response.
AmazonServiceException - If any errors occurred in Amazon S3 while processing the request.
See Also:
listObjects(String), listObjects(ListObjectsRequest)

listObjects

public ObjectListing listObjects(ListObjectsRequest listObjectsRequest)
                          throws AmazonClientException,
                                 AmazonServiceException
Description copied from interface: AmazonS3

Returns a list of summary information about the objects in the specified bucket. Depending on the request parameters, additional information is returned, such as common prefixes if a delimiter was specified. List results are always returned in lexicographic (alphabetical) order.

Because buckets can contain a virtually unlimited number of keys, the complete results of a list query can be extremely large. To manage large result sets, Amazon S3 uses pagination to split them into multiple responses. Always check the ObjectListing.isTruncated() method to see if the returned listing is complete or if additional calls are needed to get more results. Alternatively, use the listNextBatchOfObjects(ObjectListing) method as an easy way to get the next page of object listings.

Calling ListObjectsRequest.setDelimiter(String) sets the delimiter, allowing groups of keys that share the delimiter-terminated prefix to be included in the returned listing. This allows applications to organize and browse their keys hierarchically, similar to how a file system organizes files into directories. These common prefixes can be retrieved through the ObjectListing.getCommonPrefixes() method.

For example, consider a bucket that contains the following keys:

If calling listObjects with a prefix value of "foo/" and a delimiter value of "/" on this bucket, an ObjectListing is returned that contains one key ("foo/boo") and one entry in the common prefixes list ("foo/bar/"). To see deeper into the virtual hierarchy, make another call to listObjects setting the prefix parameter to any interesting common prefix to list the individual keys under that prefix.

The total number of keys in a bucket doesn't substantially affect list performance.

Specified by:
listObjects in interface AmazonS3
Parameters:
listObjectsRequest - The request object containing all options for listing the objects in a specified bucket.
Returns:
A listing of the objects in the specified bucket, along with any other associated information, such as common prefixes (if a delimiter was specified), the original request parameters, etc.
Throws:
AmazonClientException - If any errors are encountered in the client while making the request or handling the response.
AmazonServiceException - If any errors occurred in Amazon S3 while processing the request.
See Also:
listObjects(String), listObjects(String, String)

listNextBatchOfObjects

public ObjectListing listNextBatchOfObjects(ObjectListing previousObjectListing)
                                     throws AmazonClientException,
                                            AmazonServiceException
Description copied from interface: AmazonS3

Provides an easy way to continue a truncated object listing and retrieve the next page of results.

To continue the object listing and retrieve the next page of results, call the initial ObjectListing from one of the listObjects methods. If truncated (indicated when ObjectListing.isTruncated() returns true), pass the ObjectListing back into this method in order to retrieve the next page of results. Continue using this method to retrieve more results until the returned ObjectListing indicates that it is not truncated.

Specified by:
listNextBatchOfObjects in interface AmazonS3
Parameters:
previousObjectListing - The previous truncated ObjectListing. If a non-truncated ObjectListing is passed in, an empty ObjectListing is returned without ever contacting Amazon S3.
Returns:
The next set of ObjectListing results, beginning immediately after the last result in the specified previous ObjectListing.
Throws:
AmazonClientException - If any errors are encountered in the client while making the request or handling the response.
AmazonServiceException - If any errors occurred in Amazon S3 while processing the request.
See Also:
listObjects(String), listObjects(String, String), listObjects(ListObjectsRequest)

getS3AccountOwner

public Owner getS3AccountOwner()
                        throws AmazonClientException,
                               AmazonServiceException
Description copied from interface: AmazonS3

Gets the current owner of the AWS account that the authenticated sender of the request is using.

The caller must authenticate with a valid AWS Access Key ID that is registered with Amazon S3.

Specified by:
getS3AccountOwner in interface AmazonS3
Returns:
The account of the authenticated sender
Throws:
AmazonClientException - If any errors are encountered in the client while making the request or handling the response.
AmazonServiceException - If any errors occurred in Amazon S3 while processing the request.

listBuckets

public List<Bucket> listBuckets(ListBucketsRequest listBucketsRequest)
                         throws AmazonClientException,
                                AmazonServiceException
Description copied from interface: AmazonS3

Returns a list of all Amazon S3 buckets that the authenticated sender of the request owns.

Users must authenticate with a valid AWS Access Key ID that is registered with Amazon S3. Anonymous requests cannot list buckets, and users cannot list buckets that they did not create.

Specified by:
listBuckets in interface AmazonS3
Returns:
A list of all of the Amazon S3 buckets owned by the authenticated sender of the request.
Throws:
AmazonClientException - If any errors are encountered in the client while making the request or handling the response.
AmazonServiceException - If any errors occurred in Amazon S3 while processing the request.
See Also:
AmazonS3.listBuckets()

listBuckets

public List<Bucket> listBuckets()
                         throws AmazonClientException,
                                AmazonServiceException
Description copied from interface: AmazonS3

Returns a list of all Amazon S3 buckets that the authenticated sender of the request owns.

Users must authenticate with a valid AWS Access Key ID that is registered with Amazon S3. Anonymous requests cannot list buckets, and users cannot list buckets that they did not create.

Specified by:
listBuckets in interface AmazonS3
Returns:
A list of all of the Amazon S3 buckets owned by the authenticated sender of the request.
Throws:
AmazonClientException - If any errors are encountered in the client while making the request or handling the response.
AmazonServiceException - If any errors occurred in Amazon S3 while processing the request.
See Also:
AmazonS3.listBuckets(ListBucketsRequest)

getBucketLocation

public String getBucketLocation(GetBucketLocationRequest getBucketLocationRequest)
                         throws AmazonClientException,
                                AmazonServiceException
Description copied from interface: AmazonS3

Gets the geographical region where Amazon S3 stores the specified bucket.

To view the location constraint of a bucket, the user must be the bucket owner.

Use Region.fromValue(String) to get the Region enumeration value, but be prepared to handle an IllegalArgumentException if the value passed is not a known Region value.

Note that Region enumeration values are not returned directly from this method.

Specified by:
getBucketLocation in interface AmazonS3
Parameters:
getBucketLocationRequest - The request object containing the name of the Amazon S3 bucket to look up. This must be a bucket the user owns.
Returns:
The location of the specified Amazon S3 bucket.
Throws:
AmazonClientException - If any errors are encountered in the client while making the request or handling the response.
AmazonServiceException - If any errors occurred in Amazon S3 while processing the request.
See Also:
Region

getBucketLocation

public String getBucketLocation(String bucketName)
                         throws AmazonClientException,
                                AmazonServiceException
Description copied from interface: AmazonS3

Gets the geographical region where Amazon S3 stores the specified bucket.

To view the location constraint of a bucket, the user must be the bucket owner.

Use Region.fromValue(String) to get the Region enumeration value, but be prepared to handle an IllegalArgumentException if the value passed is not a known Region value.

Note that Region enumeration values are not returned directly from this method.

Specified by:
getBucketLocation in interface AmazonS3
Parameters:
bucketName - The name of the Amazon S3 bucket to look up. This must be a bucket the user owns.
Returns:
The location of the specified Amazon S3 bucket.
Throws:
AmazonClientException - If any errors are encountered in the client while making the request or handling the response.
AmazonServiceException - If any errors occurred in Amazon S3 while processing the request.
See Also:
Region

createBucket

public Bucket createBucket(String bucketName)
                    throws AmazonClientException,
                           AmazonServiceException
Description copied from interface: AmazonS3

Creates a new Amazon S3 bucket with the specified name in the default (US) region, Region.US_Standard.

Every object stored in Amazon S3 is contained within a bucket. Buckets partition the namespace of objects stored in Amazon S3 at the top level. Within a bucket, any name can be used for objects. However, bucket names must be unique across all of Amazon S3.

Bucket ownership is similar to the ownership of Internet domain names. Within Amazon S3, only a single user owns each bucket. Once a uniquely named bucket is created in Amazon S3, organize and name the objects within the bucket in any way. Ownership of the bucket is retained as long as the owner has an Amazon S3 account.

To conform with DNS requirements, the following constraints apply:

There are no limits to the number of objects that can be stored in a bucket. Performance does not vary based on the number of buckets used. Store all objects within a single bucket or organize them across several buckets.

Buckets cannot be nested; buckets cannot be created within other buckets.

Do not make bucket create or delete calls in the high availability code path of an application. Create or delete buckets in a separate initialization or setup routine that runs less often.

To create a bucket, authenticate with an account that has a valid AWS Access Key ID and is registered with Amazon S3. Anonymous requests are never allowed to create buckets.

Specified by:
createBucket in interface AmazonS3
Parameters:
bucketName - The name of the bucket to create. All buckets in Amazon S3 share a single namespace; ensure the bucket is given a unique name.
Returns:
The newly created bucket.
Throws:
AmazonClientException - If any errors are encountered in the client while making the request or handling the response.
AmazonServiceException - If any errors occurred in Amazon S3 while processing the request.

createBucket

public Bucket createBucket(String bucketName,
                           Region region)
                    throws AmazonClientException,
                           AmazonServiceException
Description copied from interface: AmazonS3

Creates a new Amazon S3 bucket with the specified name in the specified Amazon S3 region.

Every object stored in Amazon S3 is contained within a bucket. Buckets partition the namespace of objects stored in Amazon S3 at the top level. Within a bucket, any name can be used for objects. However, bucket names must be unique across all of Amazon S3.

Bucket ownership is similar to the ownership of Internet domain names. Within Amazon S3, only a single user owns each bucket. Once a uniquely named bucket is created in Amazon S3, organize and name the objects within the bucket in any way. Ownership of the bucket is retained as long as the owner has an Amazon S3 account.

To conform with DNS requirements, the following constraints apply:

There are no limits to the number of objects that can be stored in a bucket. Performance does not vary based on the number of buckets used. Store all objects within a single bucket or organize them across several buckets.

Buckets cannot be nested; buckets cannot be created within other buckets.

Do not make bucket create or delete calls in the high availability code path of an application. Create or delete buckets in a separate initialization or setup routine that runs less often.

To create a bucket, authenticate with an account that has a valid AWS Access Key ID and is registered with Amazon S3. Anonymous requests are never allowed to create buckets.

Specified by:
createBucket in interface AmazonS3
Parameters:
bucketName - The name of the bucket to create.
region - The Amazon S3 region in which to create the new bucket.
Returns:
The newly created bucket.
Throws:
AmazonClientException - If any errors are encountered in the client while making the request or handling the response.
AmazonServiceException - If any errors occurred in Amazon S3 while processing the request.
See Also:
Region

createBucket

public Bucket createBucket(String bucketName,
                           String region)
                    throws AmazonClientException,
                           AmazonServiceException
Description copied from interface: AmazonS3

Creates a new Amazon S3 bucket with the specified name in the specified Amazon S3 region. This method is provided for non-standard cases; use AmazonS3.createBucket(String, Region) and pass in a Region enumeration value in standard cases.

Every object stored in Amazon S3 is contained within a bucket. Buckets partition the namespace of objects stored in Amazon S3 at the top level. Within a bucket, any name can be used for objects. However, bucket names must be unique across all of Amazon S3.

Bucket ownership is similar to the ownership of Internet domain names. Within Amazon S3, only a single user owns each bucket. Once a uniquely named bucket is created in Amazon S3, organize and name the objects within the bucket in any way. Ownership of the bucket is retained as long as the owner has an Amazon S3 account.

To conform with DNS requirements, the following constraints apply:

There are no limits to the number of objects that can be stored in a bucket. Performance does not vary based on the number of buckets used. Store all objects within a single bucket or organize them across several buckets.

Buckets cannot be nested; buckets cannot be created within other buckets.

Do not make bucket create or delete calls in the high availability code path of an application. Create or delete buckets in a separate initialization or setup routine that runs less often.

To create a bucket, authenticate with an account that has a valid AWS Access Key ID and is registered with Amazon S3. Anonymous requests are never allowed to create buckets.

Specified by:
createBucket in interface AmazonS3
Parameters:
bucketName - The name of the bucket to create.
region - The Amazon S3 region in which to create the new bucket.
Returns:
The newly created bucket.
Throws:
AmazonClientException - If any errors are encountered in the client while making the request or handling the response.
AmazonServiceException - If any errors occurred in Amazon S3 while processing the request.
See Also:
Region

createBucket

public Bucket createBucket(CreateBucketRequest createBucketRequest)
                    throws AmazonClientException,
                           AmazonServiceException
Description copied from interface: AmazonS3

Creates a new Amazon S3 bucket in the default region, Region.US_Standard.

Every object stored in Amazon S3 is contained within a bucket. Buckets partition the namespace of objects stored in Amazon S3 at the top level. Within a bucket, any name can be used for objects. However, bucket names must be unique across all of Amazon S3.

Bucket ownership is similar to the ownership of Internet domain names. Within Amazon S3, only a single user owns each bucket. Once a uniquely named bucket is created in Amazon S3, organize and name the objects within the bucket in any way. Ownership of the bucket is retained as long as the owner has an Amazon S3 account.

To conform with DNS requirements, the following constraints apply:

There are no limits to the number of objects that can be stored in a bucket. Performance does not vary based on the number of buckets used. Store all objects within a single bucket or organize them across several buckets.

Buckets cannot be nested; buckets cannot be created within other buckets.

Do not make bucket create or delete calls in the high availability code path of an application. Create or delete buckets in a separate initialization or setup routine that runs less often.

To create a bucket, authenticate with an account that has a valid AWS Access Key ID and is registered with Amazon S3. Anonymous requests are never allowed to create buckets.

Specified by:
createBucket in interface AmazonS3
Parameters:
createBucketRequest - The request object containing all options for creating an Amazon S3 bucket.
Returns:
The newly created bucket.
Throws:
AmazonClientException - If any errors are encountered in the client while making the request or handling the response.
AmazonServiceException - If any errors occurred in Amazon S3 while processing the request.

getObjectAcl

public AccessControlList getObjectAcl(String bucketName,
                                      String key)
                               throws AmazonClientException,
                                      AmazonServiceException
Description copied from interface: AmazonS3

Gets the AccessControlList (ACL) for the specified object in Amazon S3.

Each bucket and object in Amazon S3 has an ACL that defines its access control policy. When a request is made, Amazon S3 authenticates the request using its standard authentication procedure and then checks the ACL to verify the sender was granted access to the bucket or object. If the sender is approved, the request proceeds. Otherwise, Amazon S3 returns an error.

Specified by:
getObjectAcl in interface AmazonS3
Parameters:
bucketName - The name of the bucket containing the object whose ACL is being retrieved.
key - The key of the object within the specified bucket whose ACL is being retrieved.
Returns:
The AccessControlList for the specified Amazon S3 object.
Throws:
AmazonClientException - If any errors are encountered in the client while making the request or handling the response.
AmazonServiceException - If any errors occurred in Amazon S3 while processing the request.
See Also:
AmazonS3.getObjectAcl(String, String, String)

getObjectAcl

public AccessControlList getObjectAcl(String bucketName,
                                      String key,
                                      String versionId)
                               throws AmazonClientException,
                                      AmazonServiceException
Description copied from interface: AmazonS3

Gets the AccessControlList (ACL) for the specified object with the specified version in Amazon S3. Each version of an object has its own associated ACL.

Each bucket and object in Amazon S3 has an ACL that defines its access control policy. When a request is made, Amazon S3 authenticates the request using its standard authentication procedure and then checks the ACL to verify the sender was granted access to the bucket or object. If the sender is approved, the request proceeds. Otherwise, Amazon S3 returns an error.

For more information about enabling versioning for a bucket, see AmazonS3.setBucketVersioningConfiguration(SetBucketVersioningConfigurationRequest).

Specified by:
getObjectAcl in interface AmazonS3
Parameters:
bucketName - The name of the bucket containing the object whose ACL is being retrieved.
key - The key of the object within the specified bucket whose ACL is being retrieved.
versionId - The version ID of the object version whose ACL is being retrieved.
Returns:
The AccessControlList for the specified Amazon S3 object.
Throws:
AmazonClientException - If any errors are encountered in the client while making the request or handling the response.
AmazonServiceException - If any errors occurred in Amazon S3 while processing the request.
See Also:
AmazonS3.getObjectAcl(String, String)

setObjectAcl

public void setObjectAcl(String bucketName,
                         String key,
                         AccessControlList acl)
                  throws AmazonClientException,
                         AmazonServiceException
Description copied from interface: AmazonS3

Sets the AccessControlList for the specified object in Amazon S3.

Each bucket and object in Amazon S3 has an ACL that defines its access control policy. When a request is made, Amazon S3 authenticates the request using its standard authentication procedure and then checks the ACL to verify the sender was granted access to the bucket or object. If the sender is approved, the request proceeds. Otherwise, Amazon S3 returns an error.

When constructing a custom AccessControlList, callers typically retrieve the existing AccessControlList for an object ( getObjectAcl(String, String)), modify it as necessary, and then use this method to upload the new ACL.

Specified by:
setObjectAcl in interface AmazonS3
Parameters:
bucketName - The name of the bucket containing the object whose ACL is being set.
key - The key of the object within the specified bucket whose ACL is being set.
acl - The new AccessControlList for the specified object.
Throws:
AmazonClientException - If any errors are encountered in the client while making the request or handling the response.
AmazonServiceException - If any errors occurred in Amazon S3 while processing the request.
See Also:
AmazonS3.setObjectAcl(String, String, CannedAccessControlList), AmazonS3.setObjectAcl(String, String, String, AccessControlList), AmazonS3.setObjectAcl(String, String, String, CannedAccessControlList)

setObjectAcl

public void setObjectAcl(String bucketName,
                         String key,
                         CannedAccessControlList acl)
                  throws AmazonClientException,
                         AmazonServiceException
Description copied from interface: AmazonS3

Sets the CannedAccessControlList for the specified object in Amazon S3 using one of the pre-configured CannedAccessControlLists. A CannedAccessControlList provides a quick way to configure an object or bucket with commonly used access control policies.

Each bucket and object in Amazon S3 has an ACL that defines its access control policy. When a request is made, Amazon S3 authenticates the request using its standard authentication procedure and then checks the ACL to verify the sender was granted access to the bucket or object. If the sender is approved, the request proceeds. Otherwise, Amazon S3 returns an error.

Specified by:
setObjectAcl in interface AmazonS3
Parameters:
bucketName - The name of the bucket containing the object whose ACL is being set.
key - The key of the object within the specified bucket whose ACL is being set.
acl - The new pre-configured CannedAccessControlList for the specified object.
Throws:
AmazonClientException - If any errors are encountered in the client while making the request or handling the response.
AmazonServiceException - If any errors occurred in Amazon S3 while processing the request.
See Also:
AmazonS3.setObjectAcl(String, String, AccessControlList), AmazonS3.setObjectAcl(String, String, String, AccessControlList), AmazonS3.setObjectAcl(String, String, String, CannedAccessControlList)

setObjectAcl

public void setObjectAcl(String bucketName,
                         String key,
                         String versionId,
                         AccessControlList acl)
                  throws AmazonClientException,
                         AmazonServiceException
Description copied from interface: AmazonS3

Sets the CannedAccessControlList for the specified object with the specified version in Amazon S3. Each version of an object has its own associated ACL.

Each bucket and object in Amazon S3 has an ACL that defines its access control policy. When a request is made, Amazon S3 authenticates the request using its standard authentication procedure and then checks the ACL to verify the sender was granted access to the bucket or object. If the sender is approved, the request proceeds. Otherwise, Amazon S3 returns an error.

When constructing a custom AccessControlList, callers typically retrieve the existing AccessControlList for an object ( getObjectAcl(String, String)), modify it as necessary, and then use this method to upload the new ACL.

For more information about enabling versioning for a bucket, see AmazonS3.setBucketVersioningConfiguration(SetBucketVersioningConfigurationRequest).

Specified by:
setObjectAcl in interface AmazonS3
Parameters:
bucketName - The name of the bucket containing the object whose ACL is being set.
key - The key of the object within the specified bucket whose ACL is being set.
versionId - The version ID of the object version whose ACL is being set.
acl - The new AccessControlList for the specified object.
Throws:
AmazonClientException - If any errors are encountered in the client while making the request or handling the response.
AmazonServiceException - If any errors occurred in Amazon S3 while processing the request.
See Also:
AmazonS3.setObjectAcl(String, String, AccessControlList), AmazonS3.setObjectAcl(String, String, CannedAccessControlList), AmazonS3.setObjectAcl(String, String, String, CannedAccessControlList)

setObjectAcl

public void setObjectAcl(String bucketName,
                         String key,
                         String versionId,
                         AccessControlList acl,
                         RequestMetricCollector requestMetricCollector)
                  throws AmazonClientException,
                         AmazonServiceException
Same as setObjectAcl(String, String, String, AccessControlList) but allows specifying a request metric collector.

Throws:
AmazonClientException
AmazonServiceException

setObjectAcl

public void setObjectAcl(String bucketName,
                         String key,
                         String versionId,
                         CannedAccessControlList acl)
                  throws AmazonClientException,
                         AmazonServiceException
Description copied from interface: AmazonS3

Sets the CannedAccessControlList for the specified object with the specified version ID in Amazon S3 using one of the pre-configured CannedAccessControlLists. A CannedAccessControlList provides a quick way to configure an object or bucket with commonly used access control policies.

Each bucket and object in Amazon S3 has an ACL that defines its access control policy and each version of an object has its own associated ACL. When a request is made, Amazon S3 authenticates the request using its standard authentication procedure and then checks the ACL to verify the sender was granted access to the bucket or object. If the sender is approved, the request proceeds. Otherwise, Amazon S3 returns an error.

For more information about enabling versioning for a bucket, see AmazonS3.setBucketVersioningConfiguration(SetBucketVersioningConfigurationRequest).

Specified by:
setObjectAcl in interface AmazonS3
Parameters:
bucketName - The name of the bucket containing the object whose ACL is being set.
key - The key of the object within the specified bucket whose ACL is being set.
versionId - The version ID of the object version whose ACL is being set.
acl - The new pre-configured CannedAccessControlList for the specified object.
Throws:
AmazonClientException - If any errors are encountered in the client while making the request or handling the response.
AmazonServiceException - If any errors occurred in Amazon S3 while processing the request.
See Also:
AmazonS3.setObjectAcl(String, String, AccessControlList), AmazonS3.setObjectAcl(String, String, CannedAccessControlList), AmazonS3.setObjectAcl(String, String, String, AccessControlList)

setObjectAcl

public void setObjectAcl(String bucketName,
                         String key,
                         String versionId,
                         CannedAccessControlList acl,
                         RequestMetricCollector requestMetricCollector)
Same as setObjectAcl(String, String, String, CannedAccessControlList) but allows specifying a request metric collector.


getBucketAcl

public AccessControlList getBucketAcl(String bucketName)
                               throws AmazonClientException,
                                      AmazonServiceException
Description copied from interface: AmazonS3

Gets the AccessControlList (ACL) for the specified Amazon S3 bucket.

Each bucket and object in Amazon S3 has an ACL that defines its access control policy. When a request is made, Amazon S3 authenticates the request using its standard authentication procedure and then checks the ACL to verify the sender was granted access to the bucket or object. If the sender is approved, the request proceeds. Otherwise, Amazon S3 returns an error.

Specified by:
getBucketAcl in interface AmazonS3
Parameters:
bucketName - The name of the bucket whose ACL is being retrieved.
Returns:
The AccessControlList for the specified S3 bucket.
Throws:
AmazonClientException - If any errors are encountered in the client while making the request or handling the response.
AmazonServiceException - If any errors occurred in Amazon S3 while processing the request.

getBucketAcl

public AccessControlList getBucketAcl(GetBucketAclRequest getBucketAclRequest)
                               throws AmazonClientException,
                                      AmazonServiceException
Description copied from interface: AmazonS3
Gets the AccessControlList (ACL) for the specified Amazon S3 bucket.

Each bucket and object in Amazon S3 has an ACL that defines its access control policy. When a request is made, Amazon S3 authenticates the request using its standard authentication procedure and then checks the ACL to verify the sender was granted access to the bucket or object. If the sender is approved, the request proceeds. Otherwise, Amazon S3 returns an error.

Specified by:
getBucketAcl in interface AmazonS3
Parameters:
getBucketAclRequest - The request containing the name of the bucket whose ACL is being retrieved.
Returns:
The AccessControlList for the specified S3 bucket.
Throws:
AmazonClientException - If any errors are encountered in the client while making the request or handling the response.
AmazonServiceException - If any errors occurred in Amazon S3 while processing the request.

setBucketAcl

public void setBucketAcl(String bucketName,
                         AccessControlList acl)
                  throws AmazonClientException,
                         AmazonServiceException
Description copied from interface: AmazonS3

Sets the AccessControlList for the specified Amazon S3 bucket.

Each bucket and object in Amazon S3 has an ACL that defines its access control policy. When a request is made, Amazon S3 authenticates the request using its standard authentication procedure and then checks the ACL to verify the sender was granted access to the bucket or object. If the sender is approved, the request proceeds. Otherwise, Amazon S3 returns an error.

When constructing a custom AccessControlList, callers typically retrieve the existing AccessControlList for a bucket ( getBucketAcl(String)), modify it as necessary, and then use this method to upload the new ACL.

Specified by:
setBucketAcl in interface AmazonS3
Parameters:
bucketName - The name of the bucket whose ACL is being set.
acl - The new AccessControlList for the specified bucket.
Throws:
AmazonClientException - If any errors are encountered in the client while making the request or handling the response.
AmazonServiceException - If any errors occurred in Amazon S3 while processing the request.
See Also:
AmazonS3.setBucketAcl(String, CannedAccessControlList)

setBucketAcl

public void setBucketAcl(String bucketName,
                         AccessControlList acl,
                         RequestMetricCollector requestMetricCollector)
Same as setBucketAcl(String, AccessControlList) but allows specifying a request metric collector.


setBucketAcl

public void setBucketAcl(SetBucketAclRequest setBucketAclRequest)
                  throws AmazonClientException,
                         AmazonServiceException
Description copied from interface: AmazonS3
Sets the AccessControlList for the specified Amazon S3 bucket.

Each bucket and object in Amazon S3 has an ACL that defines its access control policy. When a request is made, Amazon S3 authenticates the request using its standard authentication procedure and then checks the ACL to verify the sender was granted access to the bucket or object. If the sender is approved, the request proceeds. Otherwise, Amazon S3 returns an error.

When constructing a custom AccessControlList, callers typically retrieve the existing AccessControlList for a bucket ( getBucketAcl(String)), modify it as necessary, and then use this method to upload the new ACL.

Specified by:
setBucketAcl in interface AmazonS3
Parameters:
setBucketAclRequest - The request object containing the bucket to modify and the ACL to set.
Throws:
AmazonClientException - If any errors are encountered in the client while making the request or handling the response.
AmazonServiceException - If any errors occurred in Amazon S3 while processing the request.

setBucketAcl

public void setBucketAcl(String bucketName,
                         CannedAccessControlList acl)
                  throws AmazonClientException,
                         AmazonServiceException
Description copied from interface: AmazonS3

Sets the CannedAccessControlList for the specified Amazon S3 bucket using one of the pre-configured CannedAccessControlLists. A CannedAccessControlList provides a quick way to configure an object or bucket with commonly used access control policies.

Each bucket and object in Amazon S3 has an ACL that defines its access control policy. When a request is made, Amazon S3 authenticates the request using its standard authentication procedure and then checks the ACL to verify the sender was granted access to the bucket or object. If the sender is approved, the request proceeds. Otherwise, Amazon S3 returns an error.

Specified by:
setBucketAcl in interface AmazonS3
Parameters:
bucketName - The name of the bucket whose ACL is being set.
acl - The pre-configured CannedAccessControlLists to set for the specified bucket.
Throws:
AmazonClientException - If any errors are encountered in the client while making the request or handling the response.
AmazonServiceException - If any errors occurred in Amazon S3 while processing the request.
See Also:
AmazonS3.setBucketAcl(String, AccessControlList)

setBucketAcl

public void setBucketAcl(String bucketName,
                         CannedAccessControlList acl,
                         RequestMetricCollector requestMetricCollector)
                  throws AmazonClientException,
                         AmazonServiceException
Same as setBucketAcl(String, CannedAccessControlList) but allows specifying a request metric collector.

Throws:
AmazonClientException
AmazonServiceException

getObjectMetadata

public ObjectMetadata getObjectMetadata(String bucketName,
                                        String key)
                                 throws AmazonClientException,
                                        AmazonServiceException
Description copied from interface: AmazonS3

Gets the metadata for the specified Amazon S3 object without actually fetching the object itself. This is useful in obtaining only the object metadata, and avoids wasting bandwidth on fetching the object data.

The object metadata contains information such as content type, content disposition, etc., as well as custom user metadata that can be associated with an object in Amazon S3.

Specified by:
getObjectMetadata in interface AmazonS3
Parameters:
bucketName - The name of the bucket containing the object's whose metadata is being retrieved.
key - The key of the object whose metadata is being retrieved.
Returns:
All Amazon S3 object metadata for the specified object.
Throws:
AmazonClientException - If any errors are encountered in the client while making the request or handling the response.
AmazonServiceException - If any errors occurred in Amazon S3 while processing the request.
See Also:
AmazonS3.getObjectMetadata(GetObjectMetadataRequest)

getObjectMetadata

public ObjectMetadata getObjectMetadata(GetObjectMetadataRequest getObjectMetadataRequest)
                                 throws AmazonClientException,
                                        AmazonServiceException
Description copied from interface: AmazonS3

Gets the metadata for the specified Amazon S3 object without actually fetching the object itself. This is useful in obtaining only the object metadata, and avoids wasting bandwidth on fetching the object data.

The object metadata contains information such as content type, content disposition, etc., as well as custom user metadata that can be associated with an object in Amazon S3.

For more information about enabling versioning for a bucket, see AmazonS3.setBucketVersioningConfiguration(SetBucketVersioningConfigurationRequest).

Specified by:
getObjectMetadata in interface AmazonS3
Parameters:
getObjectMetadataRequest - The request object specifying the bucket, key and optional version ID of the object whose metadata is being retrieved.
Returns:
All S3 object metadata for the specified object.
Throws:
AmazonClientException - If any errors are encountered on the client while making the request or handling the response.
AmazonServiceException - If any errors occurred in Amazon S3 while processing the request.
See Also:
AmazonS3.getObjectMetadata(String, String)

getObject

public S3Object getObject(String bucketName,
                          String key)
                   throws AmazonClientException,
                          AmazonServiceException
Description copied from interface: AmazonS3

Gets the object stored in Amazon S3 under the specified bucket and key.

Be extremely careful when using this method; the returned Amazon S3 object contains a direct stream of data from the HTTP connection. The underlying HTTP connection cannot be closed until the user finishes reading the data and closes the stream. Therefore:

If these rules are not followed, the client can run out of resources by allocating too many open, but unused, HTTP connections.

To get an object from Amazon S3, the caller must have Permission.Read access to the object.

If the object fetched is publicly readable, it can also read it by pasting its URL into a browser.

For more advanced options (such as downloading only a range of an object's content, or placing constraints on when the object should be downloaded) callers can use AmazonS3.getObject(GetObjectRequest).

Specified by:
getObject in interface AmazonS3
Parameters:
bucketName - The name of the bucket containing the desired object.
key - The key under which the desired object is stored.
Returns:
The object stored in Amazon S3 in the specified bucket and key.
Throws:
AmazonClientException - If any errors are encountered in the client while making the request or handling the response.
AmazonServiceException - If any errors occurred in Amazon S3 while processing the request.
See Also:
AmazonS3.getObject(GetObjectRequest), AmazonS3.getObject(GetObjectRequest, File)

doesBucketExist

public boolean doesBucketExist(String bucketName)
                        throws AmazonClientException,
                               AmazonServiceException
Description copied from interface: AmazonS3
Checks if the specified bucket exists. Amazon S3 buckets are named in a global namespace; use this method to determine if a specified bucket name already exists, and therefore can't be used to create a new bucket. If invalid security credentials are used to execute this method, the client is not able to distinguish between bucket permission errors and invalid credential errors, and this method could return an incorrect result.

Specified by:
doesBucketExist in interface AmazonS3
Parameters:
bucketName - The name of the bucket to check.
Returns:
The value true if the specified bucket exists in Amazon S3; the value false if there is no bucket in Amazon S3 with that name.
Throws:
AmazonClientException - If any errors are encountered in the client while making the request or handling the response.
AmazonServiceException - If any errors occurred in Amazon S3 while processing the request.
See Also:
AmazonS3.createBucket(CreateBucketRequest)

changeObjectStorageClass

public void changeObjectStorageClass(String bucketName,
                                     String key,
                                     StorageClass newStorageClass)
                              throws AmazonClientException,
                                     AmazonServiceException
Description copied from interface: AmazonS3

Changes the Amazon S3 storage class for a specified object. Amazon S3 offers multiple storage classes for developers' different needs.

Note that changing the storage class of an object in a bucket that has enabled versioning creates a new version of the object with the new storage class. The existing version of the object persists in the current storage class.

Specified by:
changeObjectStorageClass in interface AmazonS3
Parameters:
bucketName - The name of the bucket containing the object.
key - The key of the object within the specified bucket.
newStorageClass - The new storage class for the specified object.
Throws:
AmazonClientException - If any errors are encountered in the client while making the request or handling the response.
AmazonServiceException - If any errors occurred in Amazon S3 while processing the request.

setObjectRedirectLocation

public void setObjectRedirectLocation(String bucketName,
                                      String key,
                                      String newRedirectLocation)
                               throws AmazonClientException,
                                      AmazonServiceException
Description copied from interface: AmazonS3

Changes the Amazon S3 redirect location for a specific object.

Specified by:
setObjectRedirectLocation in interface AmazonS3
Parameters:
bucketName - The name of the bucket containing the object.
key - The key of the object within the specified bucket.
newRedirectLocation - The new redirect location for the specified object.
Throws:
AmazonClientException - If any errors are encountered in the client while making the request or handling the response.
AmazonServiceException - If any errors occurred in Amazon S3 while processing the request.

getObject

public S3Object getObject(GetObjectRequest getObjectRequest)
                   throws AmazonClientException,
                          AmazonServiceException
Description copied from interface: AmazonS3

Gets the object stored in Amazon S3 under the specified bucket and key. Returns null if the specified constraints weren't met.

Callers should be very careful when using this method; the returned Amazon S3 object contains a direct stream of data from the HTTP connection. The underlying HTTP connection cannot be closed until the user finishes reading the data and closes the stream. Callers should therefore:

If callers do not follow those rules, then the client can run out of resources if allocating too many open, but unused, HTTP connections.

To get an object from Amazon S3, the caller must have Permission.Read access to the object.

If the object fetched is publicly readable, it can also read it by pasting its URL into a browser.

When specifying constraints in the request object, the client needs to be prepared to handle this method returning null if the provided constraints aren't met when Amazon S3 receives the request.

If the advanced options provided in GetObjectRequest aren't needed, use the simpler AmazonS3.getObject(String bucketName, String key) method.

Specified by:
getObject in interface AmazonS3
Parameters:
getObjectRequest - The request object containing all the options on how to download the object.
Returns:
The object stored in Amazon S3 in the specified bucket and key. Returns null if constraints were specified but not met.
Throws:
AmazonClientException - If any errors are encountered in the client while making the request or handling the response.
AmazonServiceException - If any errors occurred in Amazon S3 while processing the request.
See Also:
AmazonS3.getObject(String, String), AmazonS3.getObject(GetObjectRequest, File)

getObject

public ObjectMetadata getObject(GetObjectRequest getObjectRequest,
                                File destinationFile)
                         throws AmazonClientException,
                                AmazonServiceException
Description copied from interface: AmazonS3

Gets the object metadata for the object stored in Amazon S3 under the specified bucket and key, and saves the object contents to the specified file. Returns null if the specified constraints weren't met.

Instead of using AmazonS3.getObject(GetObjectRequest), use this method to ensure that the underlying HTTP stream resources are automatically closed as soon as possible. The Amazon S3 clients handles immediate storage of the object contents to the specified file.

To get an object from Amazon S3, the caller must have Permission.Read access to the object.

If the object fetched is publicly readable, it can also read it by pasting its URL into a browser.

When specifying constraints in the request object, the client needs to be prepared to handle this method returning null if the provided constraints aren't met when Amazon S3 receives the request.

Specified by:
getObject in interface AmazonS3
Parameters:
getObjectRequest - The request object containing all the options on how to download the Amazon S3 object content.
destinationFile - Indicates the file (which might already exist) where to save the object content being downloading from Amazon S3.
Returns:
All S3 object metadata for the specified object. Returns null if constraints were specified but not met.
Throws:
AmazonClientException - If any errors are encountered in the client while making the request, handling the response, or writing the incoming data from S3 to the specified destination file.
AmazonServiceException - If any errors occurred in Amazon S3 while processing the request.
See Also:
AmazonS3.getObject(String, String), AmazonS3.getObject(GetObjectRequest)

deleteBucket

public void deleteBucket(String bucketName)
                  throws AmazonClientException,
                         AmazonServiceException
Description copied from interface: AmazonS3

Deletes the specified bucket. All objects (and all object versions, if versioning was ever enabled) in the bucket must be deleted before the bucket itself can be deleted.

Only the owner of a bucket can delete it, regardless of the bucket's access control policy.

Specified by:
deleteBucket in interface AmazonS3
Parameters:
bucketName - The name of the bucket to delete.
Throws:
AmazonClientException - If any errors are encountered in the client while making the request or handling the response.
AmazonServiceException - If any errors occurred in Amazon S3 while processing the request.
See Also:
AmazonS3.deleteBucket(String)

deleteBucket

public void deleteBucket(DeleteBucketRequest deleteBucketRequest)
                  throws AmazonClientException,
                         AmazonServiceException
Description copied from interface: AmazonS3

Deletes the specified bucket. All objects (and all object versions, if versioning was ever enabled) in the bucket must be deleted before the bucket itself can be deleted.

Only the owner of a bucket can delete it, regardless of the bucket's access control policy (ACL).

Specified by:
deleteBucket in interface AmazonS3
Parameters:
deleteBucketRequest - The request object containing all options for deleting an Amazon S3 bucket.
Throws:
AmazonClientException - If any errors are encountered in the client while making the request or handling the response.
AmazonServiceException - If any errors occurred in Amazon S3 while processing the request.
See Also:
AmazonS3.deleteBucket(String)

putObject

public PutObjectResult putObject(String bucketName,
                                 String key,
                                 File file)
                          throws AmazonClientException,
                                 AmazonServiceException
Description copied from interface: AmazonS3

Uploads the specified file to Amazon S3 under the specified bucket and key name.

Amazon S3 never stores partial objects; if during this call an exception wasn't thrown, the entire object was stored.

The client automatically computes a checksum of the file. Amazon S3 uses checksums to validate the data in each file.

Using the file extension, Amazon S3 attempts to determine the correct content type and content disposition to use for the object.

If versioning is enabled for the specified bucket, this operation will this operation will never overwrite an existing object with the same key, but will keep the existing object as an older version until that version is explicitly deleted (see AmazonS3.deleteVersion(String, String, String).

If versioning is not enabled, this operation will overwrite an existing object with the same key; Amazon S3 will store the last write request. Amazon S3 does not provide object locking. If Amazon S3 receives multiple write requests for the same object nearly simultaneously, all of the objects might be stored. However, a single object will be stored with the final write request.

When specifying a location constraint when creating a bucket, all objects added to the bucket are stored in the bucket's region. For example, if specifying a Europe (EU) region constraint for a bucket, all of that bucket's objects are stored in EU region.

The specified bucket must already exist and the caller must have Permission.Write permission to the bucket to upload an object.

Specified by:
putObject in interface AmazonS3
Parameters:
bucketName - The name of an existing bucket, to which you have Permission.Write permission.
key - The key under which to store the specified file.
file - The file containing the data to be uploaded to Amazon S3.
Returns:
A PutObjectResult object containing the information returned by Amazon S3 for the newly created object.
Throws:
AmazonClientException - If any errors are encountered in the client while making the request or handling the response.
AmazonServiceException - If any errors occurred in Amazon S3 while processing the request.
See Also:
AmazonS3.putObject(PutObjectRequest), AmazonS3.putObject(String, String, InputStream, ObjectMetadata)

putObject

public PutObjectResult putObject(String bucketName,
                                 String key,
                                 InputStream input,
                                 ObjectMetadata metadata)
                          throws AmazonClientException,
                                 AmazonServiceException
Description copied from interface: AmazonS3

Uploads the specified input stream and object metadata to Amazon S3 under the specified bucket and key name.

Amazon S3 never stores partial objects; if during this call an exception wasn't thrown, the entire object was stored.

The client automatically computes a checksum of the file. This checksum is verified against another checksum that is calculated once the data reaches Amazon S3, ensuring the data has not corrupted in transit over the network.

Using the file extension, Amazon S3 attempts to determine the correct content type and content disposition to use for the object.

Content length must be specified before data can be uploaded to Amazon S3. If the caller doesn't provide it, the library will have to buffer the contents of the input stream in order to calculate it because Amazon S3 explicitly requires that the content length be sent in the request headers before any of the data is sent.

If versioning is enabled for the specified bucket, this operation will never overwrite an existing object at the same key, but instead will keep the existing object around as an older version until that version is explicitly deleted (see AmazonS3.deleteVersion(String, String, String).

If versioning is not enabled, this operation will overwrite an existing object with the same key; Amazon S3 will store the last write request. Amazon S3 does not provide object locking. If Amazon S3 receives multiple write requests for the same object nearly simultaneously, all of the objects might be stored. However, a single object will be stored with the final write request.

When specifying a location constraint when creating a bucket, all objects added to the bucket are stored in the bucket's region. For example, if specifying a Europe (EU) region constraint for a bucket, all of that bucket's objects are stored in EU region.

The specified bucket must already exist and the caller must have Permission.Write permission to the bucket to upload an object.

Specified by:
putObject in interface AmazonS3
Parameters:
bucketName - The name of an existing bucket, to which you have Permission.Write permission.
key - The key under which to store the specified file.
input - The input stream containing the data to be uploaded to Amazon S3.
metadata - Additional metadata instructing Amazon S3 how to handle the uploaded data (e.g. custom user metadata, hooks for specifying content type, etc.).
Returns:
A PutObjectResult object containing the information returned by Amazon S3 for the newly created object.
Throws:
AmazonClientException - If any errors are encountered in the client while making the request or handling the response.
AmazonServiceException - If any errors occurred in Amazon S3 while processing the request.
See Also:
AmazonS3.putObject(String, String, File), AmazonS3.putObject(PutObjectRequest)

putObject

public PutObjectResult putObject(PutObjectRequest putObjectRequest)
                          throws AmazonClientException,
                                 AmazonServiceException
Description copied from interface: AmazonS3

Uploads a new object to the specified Amazon S3 bucket. The PutObjectRequest contains all the details of the request, including the bucket to upload to, the key the object will be uploaded under, and the file or input stream containing the data to upload.

Amazon S3 never stores partial objects; if during this call an exception wasn't thrown, the entire object was stored.

Depending on whether a file or input stream is being uploaded, this method has slightly different behavior.

When uploading a file:

When uploading directly from an input stream:

If versioning is enabled for the specified bucket, this operation will never overwrite an existing object with the same key, but will keep the existing object as an older version until that version is explicitly deleted (see AmazonS3.deleteVersion(String, String, String).

If versioning is not enabled, this operation will overwrite an existing object with the same key; Amazon S3 will store the last write request. Amazon S3 does not provide object locking. If Amazon S3 receives multiple write requests for the same object nearly simultaneously, all of the objects might be stored. However, a single object will be stored with the final write request.

When specifying a location constraint when creating a bucket, all objects added to the bucket are stored in the bucket's region. For example, if specifying a Europe (EU) region constraint for a bucket, all of that bucket's objects are stored in the EU region.

The specified bucket must already exist and the caller must have Permission.Write permission to the bucket to upload an object.

Specified by:
putObject in interface AmazonS3
Parameters:
putObjectRequest - The request object containing all the parameters to upload a new object to Amazon S3.
Returns:
A PutObjectResult object containing the information returned by Amazon S3 for the newly created object.
Throws:
AmazonClientException - If any errors are encountered in the client while making the request or handling the response.
AmazonServiceException - If any errors occurred in Amazon S3 while processing the request.
See Also:
AmazonS3.putObject(String, String, File), AmazonS3.putObject(String, String, InputStream, ObjectMetadata)

copyObject

public CopyObjectResult copyObject(String sourceBucketName,
                                   String sourceKey,
                                   String destinationBucketName,
                                   String destinationKey)
                            throws AmazonClientException,
                                   AmazonServiceException
Description copied from interface: AmazonS3

Copies a source object to a new destination in Amazon S3.

By default, all object metadata for the source object are copied to the new destination object. The Amazon S3 AcccessControlList (ACL) is not copied to the new object; the new object will have the default Amazon S3 ACL, CannedAccessControlList.Private.

To copy an object, the caller's account must have read access to the source object and write access to the destination bucket

This method only exposes the basic options for copying an Amazon S3 object. Additional options are available by calling the copyObject(CopyObjectRequest) method, including conditional constraints for copying objects, setting ACLs, overwriting object metadata, etc.

Specified by:
copyObject in interface AmazonS3
Parameters:
sourceBucketName - The name of the bucket containing the source object to copy.
sourceKey - The key in the source bucket under which the source object is stored.
destinationBucketName - The name of the bucket in which the new object will be created. This can be the same name as the source bucket's.
destinationKey - The key in the destination bucket under which the new object will be created.
Returns:
A CopyObjectResult object containing the information returned by Amazon S3 for the newly created object.
Throws:
AmazonClientException - If any errors are encountered in the client while making the request or handling the response.
AmazonServiceException - If any errors occurred in Amazon S3 while processing the request.
See Also:
copyObject(CopyObjectRequest)

copyObject

public CopyObjectResult copyObject(CopyObjectRequest copyObjectRequest)
                            throws AmazonClientException,
                                   AmazonServiceException
Description copied from interface: AmazonS3

Copies a source object to a new destination in Amazon S3.

By default, all object metadata for the source object are copied to the new destination object, unless new object metadata in the specified CopyObjectRequest is provided.

The Amazon S3 Acccess Control List (ACL) is not copied to the new object. The new object will have the default Amazon S3 ACL, CannedAccessControlList.Private, unless one is explicitly provided in the specified CopyObjectRequest.

To copy an object, the caller's account must have read access to the source object and write access to the destination bucket.

If constraints are specified in the CopyObjectRequest (e.g. CopyObjectRequest.setMatchingETagConstraints(List)) and are not satisfied when Amazon S3 receives the request, this method returns null. This method returns a non-null result under all other circumstances.

This method exposes all the advanced options for copying an Amazon S3 object. For simple needs, use the copyObject(String, String, String, String) method.

Specified by:
copyObject in interface AmazonS3
Parameters:
copyObjectRequest - The request object containing all the options for copying an Amazon S3 object.
Returns:
A CopyObjectResult object containing the information returned by Amazon S3 about the newly created object, or null if constraints were specified that weren't met when Amazon S3 attempted to copy the object.
Throws:
AmazonClientException - If any errors are encountered in the client while making the request or handling the response.
AmazonServiceException - If any errors occurred in Amazon S3 while processing the request.
See Also:
copyObject(String, String, String, String)

copyPart

public CopyPartResult copyPart(CopyPartRequest copyPartRequest)
Copies a source object to a part of a multipart upload. To copy an object, the caller's account must have read access to the source object and write access to the destination bucket.

If constraints are specified in the CopyPartRequest (e.g. CopyPartRequest.setMatchingETagConstraints(List)) and are not satisfied when Amazon S3 receives the request, this method returns null. This method returns a non-null result under all other circumstances.

Specified by:
copyPart in interface AmazonS3
Parameters:
copyPartRequest - The request object containing all the options for copying an Amazon S3 object.
Returns:
A CopyPartResult object containing the information returned by Amazon S3 about the newly created object, or null if constraints were specified that weren't met when Amazon S3 attempted to copy the object.
Throws:
AmazonClientException - If any errors are encountered in the client while making the request or handling the response.
AmazonServiceException - If any errors occurred in Amazon S3 while processing the request.
See Also:
AmazonS3.copyObject(CopyObjectRequest), AmazonS3.initiateMultipartUpload(InitiateMultipartUploadRequest)

deleteObject

public void deleteObject(String bucketName,
                         String key)
                  throws AmazonClientException,
                         AmazonServiceException
Description copied from interface: AmazonS3

Deletes the specified object in the specified bucket. Once deleted, the object can only be restored if versioning was enabled when the object was deleted.

If attempting to delete an object that does not exist, Amazon S3 returns a success message instead of an error message.

Specified by:
deleteObject in interface AmazonS3
Parameters:
bucketName - The name of the Amazon S3 bucket containing the object to delete.
key - The key of the object to delete.
Throws:
AmazonClientException - If any errors are encountered in the client while making the request or handling the response.
AmazonServiceException - If any errors occurred in Amazon S3 while processing the request.
See Also:
deleteObject(DeleteObjectRequest)

deleteObject

public void deleteObject(DeleteObjectRequest deleteObjectRequest)
                  throws AmazonClientException,
                         AmazonServiceException
Description copied from interface: AmazonS3

Deletes the specified object in the specified bucket. Once deleted, the object can only be restored if versioning was enabled when the object was deleted.

If attempting to delete an object that does not exist, Amazon S3 will return a success message instead of an error message.

Specified by:
deleteObject in interface AmazonS3
Parameters:
deleteObjectRequest - The request object containing all options for deleting an Amazon S3 object.
Throws:
AmazonClientException - If any errors are encountered in the client while making the request or handling the response.
AmazonServiceException - If any errors occurred in Amazon S3 while processing the request.
See Also:
deleteObject(String, String)

deleteObjects

public DeleteObjectsResult deleteObjects(DeleteObjectsRequest deleteObjectsRequest)
Description copied from interface: AmazonS3
Deletes multiple objects in a single bucket from S3.

In some cases, some objects will be successfully deleted, while some attempts will cause an error. If any object in the request cannot be deleted, this method throws a MultiObjectDeleteException with details of the error.

Specified by:
deleteObjects in interface AmazonS3
Parameters:
deleteObjectsRequest - The request object containing all options for deleting multiple objects.

deleteVersion

public void deleteVersion(String bucketName,
                          String key,
                          String versionId)
                   throws AmazonClientException,
                          AmazonServiceException
Description copied from interface: AmazonS3

Deletes a specific version of the specified object in the specified bucket. Once deleted, there is no method to restore or undelete an object version. This is the only way to permanently delete object versions that are protected by versioning.

Deleting an object version is permanent and irreversible. It is a privileged operation that only the owner of the bucket containing the version can perform.

Users can only delete a version of an object if versioning is enabled for the bucket. For more information about enabling versioning for a bucket, see AmazonS3.setBucketVersioningConfiguration(SetBucketVersioningConfigurationRequest).

If attempting to delete an object that does not exist, Amazon S3 will return a success message instead of an error message.

Specified by:
deleteVersion in interface AmazonS3
Parameters:
bucketName - The name of the Amazon S3 bucket containing the object to delete.
key - The key of the object to delete.
versionId - The version of the object to delete.
Throws:
AmazonClientException - If any errors are encountered in the client while making the request or handling the response.
AmazonServiceException - If any errors occurred in Amazon S3 while processing the request.

deleteVersion

public void deleteVersion(DeleteVersionRequest deleteVersionRequest)
                   throws AmazonClientException,
                          AmazonServiceException
Description copied from interface: AmazonS3

Deletes a specific version of an object in the specified bucket. Once deleted, there is no method to restore or undelete an object version. This is the only way to permanently delete object versions that are protected by versioning.

Deleting an object version is permanent and irreversible. It is a privileged operation that only the owner of the bucket containing the version can perform.

Users can only delete a version of an object if versioning is enabled for the bucket. For more information about enabling versioning for a bucket, see AmazonS3.setBucketVersioningConfiguration(SetBucketVersioningConfigurationRequest).

If attempting to delete an object that does not exist, Amazon S3 will return a success message instead of an error message.

Specified by:
deleteVersion in interface AmazonS3
Parameters:
deleteVersionRequest - The request object containing all options for deleting a specific version of an Amazon S3 object.
Throws:
AmazonClientException - If any errors are encountered in the client while making the request or handling the response.
AmazonServiceException - If any errors occurred in Amazon S3 while processing the request.

setBucketVersioningConfiguration

public void setBucketVersioningConfiguration(SetBucketVersioningConfigurationRequest setBucketVersioningConfigurationRequest)
                                      throws AmazonClientException,
                                             AmazonServiceException
Description copied from interface: AmazonS3

Sets the versioning configuration for the specified bucket.

A bucket's versioning configuration can be in one of three possible states:

By default, new buckets are in the off state. Once versioning is enabled for a bucket the status can never be reverted to off.

Objects created before versioning was enabled or when versioning is suspended will be given the default null version ID (see Constants#NULL_VERSION_ID). Note that the null version ID is a valid version ID and is not the same as not having a version ID.

The versioning configuration of a bucket has different implications for each operation performed on that bucket or for objects within that bucket. For example, when versioning is enabled a PutObject operation creates a unique object version-id for the object being uploaded. The The PutObject API guarantees that, if versioning is enabled for a bucket at the time of the request, the new object can only be permanently deleted using a DeleteVersion operation. It can never be overwritten. Additionally, the PutObject API guarantees that, if versioning is enabled for a bucket the request, no other object will be overwritten by that request. Refer to the documentation sections for each API for information on how versioning status affects the semantics of that particular API.

Amazon S3 is eventually consistent. It can take time for the versioning status of a bucket to be propagated throughout the system.

Specified by:
setBucketVersioningConfiguration in interface AmazonS3
Parameters:
setBucketVersioningConfigurationRequest - The request object containing all options for setting the bucket versioning configuration.
Throws:
AmazonClientException - If any errors are encountered in the client while making the request or handling the response.
AmazonServiceException - If any errors occurred in Amazon S3 while processing the request.
See Also:
AmazonS3.getBucketVersioningConfiguration(String)

getBucketVersioningConfiguration

public BucketVersioningConfiguration getBucketVersioningConfiguration(String bucketName)
                                                               throws AmazonClientException,
                                                                      AmazonServiceException
Description copied from interface: AmazonS3

Returns the versioning configuration for the specified bucket.

A bucket's versioning configuration can be in one of three possible states:

By default, new buckets are in the off state. Once versioning is enabled for a bucket the status can never be reverted to off.

The versioning configuration of a bucket has different implications for each operation performed on that bucket or for objects within that bucket. For example, when versioning is enabled a PutObject operation creates a unique object version-id for the object being uploaded. The The PutObject API guarantees that, if versioning is enabled for a bucket at the time of the request, the new object can only be permanently deleted using a DeleteVersion operation. It can never be overwritten. Additionally, the PutObject API guarantees that, if versioning is enabled for a bucket the request, no other object will be overwritten by that request. Refer to the documentation sections for each API for information on how versioning status affects the semantics of that particular API.

Amazon S3 is eventually consistent. It can take time for the versioning status of a bucket to be propagated throughout the system.

Specified by:
getBucketVersioningConfiguration in interface AmazonS3
Parameters:
bucketName - The bucket whose versioning configuration will be retrieved.
Returns:
The bucket versioning configuration for the specified bucket.
Throws:
AmazonClientException - If any errors are encountered in the client while making the request or handling the response.
AmazonServiceException - If any errors occurred in Amazon S3 while processing the request.
See Also:
AmazonS3.setBucketVersioningConfiguration(SetBucketVersioningConfigurationRequest)

getBucketWebsiteConfiguration

public BucketWebsiteConfiguration getBucketWebsiteConfiguration(String bucketName)
                                                         throws AmazonClientException,
                                                                AmazonServiceException
Description copied from interface: AmazonS3
Returns the website configuration for the specified bucket. Bucket website configuration allows you to host your static websites entirely out of Amazon S3. To host your website in Amazon S3, create a bucket, upload your files, and configure it as a website. Once your bucket has been configured as a website, you can access all your content via the Amazon S3 website endpoint. To ensure that the existing Amazon S3 REST API will continue to behave the same, regardless of whether or not your bucket has been configured to host a website, a new HTTP endpoint has been introduced where you can access your content. The bucket content you want to make available via the website must be publicly readable.

For more information on how to host a website on Amazon S3, see: http://docs.amazonwebservices.com/AmazonS3/latest/dev/WebsiteHosting.html.

This operation requires the S3:GetBucketWebsite permission. By default, only the bucket owner can read the bucket website configuration. However, bucket owners can allow other users to read the website configuration by writing a bucket policy granting them the S3:GetBucketWebsite permission.

Specified by:
getBucketWebsiteConfiguration in interface AmazonS3
Parameters:
bucketName - The name of the bucket whose website configuration is being retrieved.
Returns:
The bucket website configuration for the specified bucket, otherwise null if there is no website configuration set for the specified bucket.
Throws:
AmazonClientException - If any errors are encountered on the client while making the request or handling the response.
AmazonServiceException - If any errors occurred in Amazon S3 while processing the request.

getBucketWebsiteConfiguration

public BucketWebsiteConfiguration getBucketWebsiteConfiguration(GetBucketWebsiteConfigurationRequest getBucketWebsiteConfigurationRequest)
                                                         throws AmazonClientException,
                                                                AmazonServiceException
Description copied from interface: AmazonS3
Returns the website configuration for the specified bucket. Bucket website configuration allows you to host your static websites entirely out of Amazon S3. To host your website in Amazon S3, create a bucket, upload your files, and configure it as a website. Once your bucket has been configured as a website, you can access all your content via the Amazon S3 website endpoint. To ensure that the existing Amazon S3 REST API will continue to behave the same, regardless of whether or not your bucket has been configured to host a website, a new HTTP endpoint has been introduced where you can access your content. The bucket content you want to make available via the website must be publicly readable.

For more information on how to host a website on Amazon S3, see: http://docs.amazonwebservices.com/AmazonS3/latest/dev/WebsiteHosting. html.

This operation requires the S3:GetBucketWebsite permission. By default, only the bucket owner can read the bucket website configuration. However, bucket owners can allow other users to read the website configuration by writing a bucket policy granting them the S3:GetBucketWebsite permission.

Specified by:
getBucketWebsiteConfiguration in interface AmazonS3
Parameters:
getBucketWebsiteConfigurationRequest - The request object containing all the information on the specific bucket whose website configuration is to be retrieved.
Returns:
The bucket website configuration for the specified bucket, otherwise null if there is no website configuration set for the specified bucket.
Throws:
AmazonClientException - If any errors are encountered on the client while making the request or handling the response.
AmazonServiceException - If any errors occurred in Amazon S3 while processing the request.

getBucketLifecycleConfiguration

public BucketLifecycleConfiguration getBucketLifecycleConfiguration(String bucketName)
Description copied from interface: AmazonS3
Gets the lifecycle configuration for the specified bucket, or null if no configuration has been established.

Specified by:
getBucketLifecycleConfiguration in interface AmazonS3
Parameters:
bucketName - The name of the bucket for which to retrieve lifecycle configuration.

setBucketLifecycleConfiguration

public void setBucketLifecycleConfiguration(String bucketName,
                                            BucketLifecycleConfiguration bucketLifecycleConfiguration)
Description copied from interface: AmazonS3
Sets the lifecycle configuration for the specified bucket.

Specified by:
setBucketLifecycleConfiguration in interface AmazonS3
Parameters:
bucketName - The name of the bucket for which to set the lifecycle configuration.
bucketLifecycleConfiguration - The new lifecycle configuration for this bucket, which completely replaces any existing configuration.

setBucketLifecycleConfiguration

public void setBucketLifecycleConfiguration(SetBucketLifecycleConfigurationRequest setBucketLifecycleConfigurationRequest)
Description copied from interface: AmazonS3
Sets the lifecycle configuration for the specified bucket.

Specified by:
setBucketLifecycleConfiguration in interface AmazonS3
Parameters:
setBucketLifecycleConfigurationRequest - The request object containing all options for setting the bucket lifecycle configuration.

deleteBucketLifecycleConfiguration

public void deleteBucketLifecycleConfiguration(String bucketName)
Description copied from interface: AmazonS3
Removes the lifecycle configuration for the bucket specified.

Specified by:
deleteBucketLifecycleConfiguration in interface AmazonS3
Parameters:
bucketName - The name of the bucket for which to remove the lifecycle configuration.

deleteBucketLifecycleConfiguration

public void deleteBucketLifecycleConfiguration(DeleteBucketLifecycleConfigurationRequest deleteBucketLifecycleConfigurationRequest)
Description copied from interface: AmazonS3
Removes the lifecycle configuration for the bucket specified.

Specified by:
deleteBucketLifecycleConfiguration in interface AmazonS3
Parameters:
deleteBucketLifecycleConfigurationRequest - The request object containing all options for removing the bucket lifecycle configuration.

getBucketCrossOriginConfiguration

public BucketCrossOriginConfiguration getBucketCrossOriginConfiguration(String bucketName)
Description copied from interface: AmazonS3
Gets the cross origin configuration for the specified bucket, or null if no configuration has been established.

Specified by:
getBucketCrossOriginConfiguration in interface AmazonS3
Parameters:
bucketName - The name of the bucket for which to retrieve cross origin configuration.

setBucketCrossOriginConfiguration

public void setBucketCrossOriginConfiguration(String bucketName,
                                              BucketCrossOriginConfiguration bucketCrossOriginConfiguration)
Description copied from interface: AmazonS3
Sets the cross origin configuration for the specified bucket.

Specified by:
setBucketCrossOriginConfiguration in interface AmazonS3
Parameters:
bucketName - The name of the bucket for which to retrieve cross origin configuration.
bucketCrossOriginConfiguration - The new cross origin configuration for this bucket, which completely replaces any existing configuration.

setBucketCrossOriginConfiguration

public void setBucketCrossOriginConfiguration(SetBucketCrossOriginConfigurationRequest setBucketCrossOriginConfigurationRequest)
Description copied from interface: AmazonS3
Sets the cross origin configuration for the specified bucket.

Specified by:
setBucketCrossOriginConfiguration in interface AmazonS3
Parameters:
setBucketCrossOriginConfigurationRequest - The request object containing all options for setting the bucket cross origin configuration.

deleteBucketCrossOriginConfiguration

public void deleteBucketCrossOriginConfiguration(String bucketName)
Description copied from interface: AmazonS3
Delete the cross origin configuration for the specified bucket.

Specified by:
deleteBucketCrossOriginConfiguration in interface AmazonS3
Parameters:
bucketName - The name of the bucket for which to retrieve cross origin configuration.

deleteBucketCrossOriginConfiguration

public void deleteBucketCrossOriginConfiguration(DeleteBucketCrossOriginConfigurationRequest deleteBucketCrossOriginConfigurationRequest)
Description copied from interface: AmazonS3
Delete the cross origin configuration for the specified bucket.

Specified by:
deleteBucketCrossOriginConfiguration in interface AmazonS3
Parameters:
deleteBucketCrossOriginConfigurationRequest - The request object containing all options for deleting the bucket cross origin configuration.

getBucketTaggingConfiguration

public BucketTaggingConfiguration getBucketTaggingConfiguration(String bucketName)
Description copied from interface: AmazonS3
Gets the tagging configuration for the specified bucket, or null if no configuration has been established.

Specified by:
getBucketTaggingConfiguration in interface AmazonS3
Parameters:
bucketName - The name of the bucket for which to retrieve tagging configuration.

setBucketTaggingConfiguration

public void setBucketTaggingConfiguration(String bucketName,
                                          BucketTaggingConfiguration bucketTaggingConfiguration)
Description copied from interface: AmazonS3
Sets the tagging configuration for the specified bucket.

Specified by:
setBucketTaggingConfiguration in interface AmazonS3
Parameters:
bucketName - The name of the bucket for which to set the tagging configuration.
bucketTaggingConfiguration - The new tagging configuration for this bucket, which completely replaces any existing configuration.

setBucketTaggingConfiguration

public void setBucketTaggingConfiguration(SetBucketTaggingConfigurationRequest setBucketTaggingConfigurationRequest)
Description copied from interface: AmazonS3
Sets the tagging configuration for the specified bucket.

Specified by:
setBucketTaggingConfiguration in interface AmazonS3
Parameters:
setBucketTaggingConfigurationRequest - The request object containing all options for setting the bucket tagging configuration.

deleteBucketTaggingConfiguration

public void deleteBucketTaggingConfiguration(String bucketName)
Description copied from interface: AmazonS3
Removes the tagging configuration for the bucket specified.

Specified by:
deleteBucketTaggingConfiguration in interface AmazonS3
Parameters:
bucketName - The name of the bucket for which to remove the tagging configuration.

deleteBucketTaggingConfiguration

public void deleteBucketTaggingConfiguration(DeleteBucketTaggingConfigurationRequest deleteBucketTaggingConfigurationRequest)
Description copied from interface: AmazonS3
Removes the tagging configuration for the bucket specified.

Specified by:
deleteBucketTaggingConfiguration in interface AmazonS3

setBucketWebsiteConfiguration

public void setBucketWebsiteConfiguration(String bucketName,
                                          BucketWebsiteConfiguration configuration)
                                   throws AmazonClientException,
                                          AmazonServiceException
Description copied from interface: AmazonS3
Sets the website configuration for the specified bucket. Bucket website configuration allows you to host your static websites entirely out of Amazon S3. To host your website in Amazon S3, create a bucket, upload your files, and configure it as a website. Once your bucket has been configured as a website, you can access all your content via the Amazon S3 website endpoint. To ensure that the existing Amazon S3 REST API will continue to behave the same, regardless of whether or not your bucket has been configured to host a website, a new HTTP endpoint has been introduced where you can access your content. The bucket content you want to make available via the website must be publicly readable.

For more information on how to host a website on Amazon S3, see: http://docs.amazonwebservices.com/AmazonS3/latest/dev/WebsiteHosting.html.

This operation requires the S3:PutBucketWebsite permission. By default, only the bucket owner can configure the website attached to a bucket. However, bucket owners can allow other users to set the website configuration by writing a bucket policy granting them the S3:PutBucketWebsite permission.

Specified by:
setBucketWebsiteConfiguration in interface AmazonS3
Parameters:
bucketName - The name of the bucket whose website configuration is being set.
configuration - The configuration describing how the specified bucket will serve web requests (i.e. default index page, error page).
Throws:
AmazonClientException - If any errors are encountered on the client while making the request or handling the response.
AmazonServiceException - If any errors occurred in Amazon S3 while processing the request.

setBucketWebsiteConfiguration

public void setBucketWebsiteConfiguration(SetBucketWebsiteConfigurationRequest setBucketWebsiteConfigurationRequest)
                                   throws AmazonClientException,
                                          AmazonServiceException
Description copied from interface: AmazonS3
Sets the website configuration for the specified bucket. Bucket website configuration allows you to host your static websites entirely out of Amazon S3. To host your website in Amazon S3, create a bucket, upload your files, and configure it as a website. Once your bucket has been configured as a website, you can access all your content via the Amazon S3 website endpoint. To ensure that the existing Amazon S3 REST API will continue to behave the same, regardless of whether or not your bucket has been configured to host a website, a new HTTP endpoint has been introduced where you can access your content. The bucket content you want to make available via the website must be publicly readable.

For more information on how to host a website on Amazon S3, see: http://docs.amazonwebservices.com/AmazonS3/latest/dev/WebsiteHosting. html.

This operation requires the S3:PutBucketWebsite permission. By default, only the bucket owner can configure the website attached to a bucket. However, bucket owners can allow other users to set the website configuration by writing a bucket policy granting them the S3:PutBucketWebsite permission.

Specified by:
setBucketWebsiteConfiguration in interface AmazonS3
Parameters:
setBucketWebsiteConfigurationRequest - The request object containing the name of the bucket whose website configuration is being updated, and the new website configuration values.
Throws:
AmazonClientException - If any errors are encountered on the client while making the request or handling the response.
AmazonServiceException - If any errors occurred in Amazon S3 while processing the request.

deleteBucketWebsiteConfiguration

public void deleteBucketWebsiteConfiguration(String bucketName)
                                      throws AmazonClientException,
                                             AmazonServiceException
Description copied from interface: AmazonS3
This operation removes the website configuration for a bucket. Calling this operation on a bucket with no website configuration does not throw an exception. Calling this operation a bucket that does not exist will throw an exception.

For more information on how to host a website on Amazon S3, see: http://docs.amazonwebservices.com/AmazonS3/latest/dev/WebsiteHosting.html.

This operation requires the S3:DeleteBucketWebsite permission. By default, only the bucket owner can delete the website configuration attached to a bucket. However, bucket owners can grant other users permission to delete the website configuration by writing a bucket policy granting them the S3:DeleteBucketWebsite permission.

Specified by:
deleteBucketWebsiteConfiguration in interface AmazonS3
Parameters:
bucketName - The name of the bucket whose website configuration is being deleted.
Throws:
AmazonClientException - If any errors are encountered on the client while making the request or handling the response.
AmazonServiceException - If any errors occurred in Amazon S3 while processing the request.

deleteBucketWebsiteConfiguration

public void deleteBucketWebsiteConfiguration(DeleteBucketWebsiteConfigurationRequest deleteBucketWebsiteConfigurationRequest)
                                      throws AmazonClientException,
                                             AmazonServiceException
Description copied from interface: AmazonS3
This operation removes the website configuration for a bucket. Calling this operation on a bucket with no website configuration does not throw an exception. Calling this operation a bucket that does not exist will throw an exception.

For more information on how to host a website on Amazon S3, see: http://docs.amazonwebservices.com/AmazonS3/latest/dev/WebsiteHosting. html.

This operation requires the S3:DeleteBucketWebsite permission. By default, only the bucket owner can delete the website configuration attached to a bucket. However, bucket owners can grant other users permission to delete the website configuration by writing a bucket policy granting them the S3:DeleteBucketWebsite permission.

Specified by:
deleteBucketWebsiteConfiguration in interface AmazonS3
Parameters:
deleteBucketWebsiteConfigurationRequest - The request object specifying the name of the bucket whose website configuration is to be deleted.
Throws:
AmazonClientException - If any errors are encountered on the client while making the request or handling the response.
AmazonServiceException - If any errors occurred in Amazon S3 while processing the request.

setBucketNotificationConfiguration

public void setBucketNotificationConfiguration(String bucketName,
                                               BucketNotificationConfiguration bucketNotificationConfiguration)
                                        throws AmazonClientException,
                                               AmazonServiceException
Description copied from interface: AmazonS3
Sets the notification configuration for the specified bucket.

By default, new buckets have no notification configuration set.

The notification configuration of a bucket provides near realtime notifications of events the user is interested in, using SNS as the delivery service. Notification is turned on by enabling configuration on a bucket, specifying the events and the SNS topic. This configuration can only be turned on by the bucket owner. If a notification configuration already exists for the specified bucket, the new notification configuration will replace the existing notification configuration. To remove the notification configuration pass in an empty request. Currently, buckets may only have a single event and topic configuration.

S3 is eventually consistent. It may take time for the notification status of a bucket to be propagated throughout the system.

Specified by:
setBucketNotificationConfiguration in interface AmazonS3
Parameters:
bucketName - The name of the Amazon S3 bucket whose notification configuration is being set.
bucketNotificationConfiguration - The request object containing all options for setting the bucket notification configuration.
Throws:
AmazonClientException - If any errors are encountered on the client while making the request or handling the response.
AmazonServiceException - If any errors occurred in Amazon S3 while processing the request.

setBucketNotificationConfiguration

public void setBucketNotificationConfiguration(SetBucketNotificationConfigurationRequest setBucketNotificationConfigurationRequest)
                                        throws AmazonClientException,
                                               AmazonServiceException
Description copied from interface: AmazonS3
Sets the notification configuration for the specified bucket.

By default, new buckets have no notification configuration set.

The notification configuration of a bucket provides near realtime notifications of events the user is interested in, using SNS as the delivery service. Notification is turned on by enabling configuration on a bucket, specifying the events and the SNS topic. This configuration can only be turned on by the bucket owner. If a notification configuration already exists for the specified bucket, the new notification configuration will replace the existing notification configuration. To remove the notification configuration pass in an empty request. Currently, buckets may only have a single event and topic configuration.

S3 is eventually consistent. It may take time for the notification status of a bucket to be propagated throughout the system.

Specified by:
setBucketNotificationConfiguration in interface AmazonS3
Parameters:
setBucketNotificationConfigurationRequest - The request object containing all options for setting the bucket notification configuration.
Throws:
AmazonClientException - If any errors are encountered on the client while making the request or handling the response.
AmazonServiceException - If any errors occurred in Amazon S3 while processing the request.

getBucketNotificationConfiguration

public BucketNotificationConfiguration getBucketNotificationConfiguration(String bucketName)
                                                                   throws AmazonClientException,
                                                                          AmazonServiceException
Description copied from interface: AmazonS3
Gets the notification configuration for the specified bucket.

By default, new buckets have no notification configuration.

The notification configuration of a bucket provides near realtime notifications of events the user is interested in, using SNS as the delivery service. Notification is turned on by enabling configuration on a bucket, specifying the events and the SNS topic. This configuration can only be turned on by the bucket owner. If a notification configuration already exists for the specified bucket, the new notification configuration will replace the existing notification configuration. To remove the notification configuration pass in an empty request. Currently, buckets may only have a single event and topic configuration.

S3 is eventually consistent. It may take time for the notification status of a bucket to be propagated throughout the system.

Specified by:
getBucketNotificationConfiguration in interface AmazonS3
Parameters:
bucketName - The bucket whose notification configuration will be retrieved.
Returns:
The bucket notification configuration for the specified bucket.
Throws:
AmazonClientException - If any errors are encountered on the client while making the request or handling the response.
AmazonServiceException - If any errors occurred in Amazon S3 while processing the request.

getBucketLoggingConfiguration

public BucketLoggingConfiguration getBucketLoggingConfiguration(String bucketName)
                                                         throws AmazonClientException,
                                                                AmazonServiceException
Description copied from interface: AmazonS3

Gets the logging configuration for the specified bucket. The bucket logging configuration object indicates if server access logging is enabled the specified bucket, the destination bucket where server access logs are delivered, and the optional log file prefix.

Specified by:
getBucketLoggingConfiguration in interface AmazonS3
Parameters:
bucketName - The name of the bucket whose bucket logging configuration is being retrieved.
Returns:
The bucket logging configuration for the specified bucket.
Throws:
AmazonClientException - If any errors are encountered in the client while making the request or handling the response.
AmazonServiceException - If any errors occurred in Amazon S3 while processing the request.
See Also:
AmazonS3.setBucketLoggingConfiguration(SetBucketLoggingConfigurationRequest)

setBucketLoggingConfiguration

public void setBucketLoggingConfiguration(SetBucketLoggingConfigurationRequest setBucketLoggingConfigurationRequest)
                                   throws AmazonClientException,
                                          AmazonServiceException
Description copied from interface: AmazonS3

Sets the logging configuration for the specified bucket. The bucket logging configuration object indicates whether server access logging is enabled or not for the specified bucket, the destination bucket where server access logs are delivered, and the optional log file prefix.

In order to deliver server access logs, the destination bucket must have log delivery write permissions. You can use the CannedAccessControlList.LogDeliveryWrite ACL to quickly add the correct permissions to your destination bucket, or you can modify the bucket's existing ACL to grant the GroupGrantee.LogDelivery group grantee the Permission.Write permission.

Changes to the logging status for a bucket are visible in the configuration API immediately, but they take time to actually affect the delivery of log files. For example, if logging is enabled for a bucket, some requests made in the following hour might be logged, while others might not. Or, if you change the target bucket for logging from bucket A to bucket B, some logs for the next hour might continue to be delivered to bucket A, while others might be delivered to the new target bucket B. In all cases, the new settings will eventually take effect without any further action on your part.

Specified by:
setBucketLoggingConfiguration in interface AmazonS3
Parameters:
setBucketLoggingConfigurationRequest - The request object containing all options for setting the bucket logging configuration.
Throws:
AmazonClientException - If any errors are encountered in the client while making the request or handling the response.
AmazonServiceException - If any errors occurred in Amazon S3 while processing the request.
See Also:
AmazonS3.getBucketLoggingConfiguration(String)

getBucketPolicy

public BucketPolicy getBucketPolicy(String bucketName)
                             throws AmazonClientException,
                                    AmazonServiceException
Description copied from interface: AmazonS3

Gets the policy for the specified bucket. Only the owner of the bucket can retrieve the policy. If no policy has been set for the bucket, then an empty result object with a null policy text field will be returned.

Bucket policies provide access control management at the bucket level for both the bucket resource and contained object resources. Only one policy can be specified per-bucket.

See the Amazon S3 developer guide for more information on forming bucket polices.

Specified by:
getBucketPolicy in interface AmazonS3
Parameters:
bucketName - The name of the Amazon S3 bucket whose policy is being retrieved.
Returns:
The Amazon S3 bucket policy for the specified bucket.
Throws:
AmazonClientException - If any errors are encountered in the client while making the request or handling the response.
AmazonServiceException - If any errors occurred in Amazon S3 while processing the request.
See Also:
AmazonS3.setBucketPolicy(String, String)

setBucketPolicy

public void setBucketPolicy(String bucketName,
                            String policyText)
                     throws AmazonClientException,
                            AmazonServiceException
Description copied from interface: AmazonS3

Sets the policy associated with the specified bucket. Only the owner of the bucket can set a bucket policy. If a policy already exists for the specified bucket, the new policy replaces the existing policy.

Bucket policies provide access control management at the bucket level for both the bucket resource and contained object resources. Only one policy can be specified per-bucket.

See the Amazon S3 developer guide for more information on forming bucket polices.

Specified by:
setBucketPolicy in interface AmazonS3
Parameters:
bucketName - The name of the Amazon S3 bucket whose policy is being set.
policyText - The policy to apply to the specified bucket.
Throws:
AmazonClientException - If any errors are encountered in the client while making the request or handling the response.
AmazonServiceException - If any errors occurred in Amazon S3 while processing the request.

deleteBucketPolicy

public void deleteBucketPolicy(String bucketName)
                        throws AmazonClientException,
                               AmazonServiceException
Description copied from interface: AmazonS3

Deletes the policy associated with the specified bucket. Only the owner of the bucket can delete the bucket policy.

Bucket policies provide access control management at the bucket level for both the bucket resource and contained object resources. Only one policy can be specified per-bucket.

See the Amazon S3 developer guide for more information on forming bucket polices.

Specified by:
deleteBucketPolicy in interface AmazonS3
Parameters:
bucketName - The name of the Amazon S3 bucket whose policy is being deleted.
Throws:
AmazonClientException - If any errors are encountered in the client while making the request or handling the response.
AmazonServiceException - If any errors occurred in Amazon S3 while processing the request.

getBucketPolicy

public BucketPolicy getBucketPolicy(GetBucketPolicyRequest getBucketPolicyRequest)
                             throws AmazonClientException,
                                    AmazonServiceException
Description copied from interface: AmazonS3

Gets the policy for the specified bucket. Only the owner of the bucket can retrieve the policy. If no policy has been set for the bucket, then an empty result object with a null policy text field will be returned.

Bucket policies provide access control management at the bucket level for both the bucket resource and contained object resources. Only one policy can be specified per-bucket.

See the Amazon S3 developer guide for more information on forming bucket polices.

Specified by:
getBucketPolicy in interface AmazonS3
Parameters:
getBucketPolicyRequest - The request object containing all of the details for retreiving a bucket's policy.
Returns:
The Amazon S3 bucket policy for the specified bucket.
Throws:
AmazonClientException - If any errors are encountered in the client while making the request or handling the response.
AmazonServiceException - If any errors occurred in Amazon S3 while processing the request.
See Also:
AmazonS3.setBucketPolicy(String, String)

setBucketPolicy

public void setBucketPolicy(SetBucketPolicyRequest setBucketPolicyRequest)
                     throws AmazonClientException,
                            AmazonServiceException
Description copied from interface: AmazonS3

Sets the policy associated with the specified bucket. Only the owner of the bucket can set a bucket policy. If a policy already exists for the specified bucket, the new policy replaces the existing policy.

Bucket policies provide access control management at the bucket level for both the bucket resource and contained object resources. Only one policy can be specified per-bucket.

See the Amazon S3 developer guide for more information on forming bucket polices.

Specified by:
setBucketPolicy in interface AmazonS3
Parameters:
setBucketPolicyRequest - The request object containing the details of the bucket and policy to update.
Throws:
AmazonClientException - If any errors are encountered in the client while making the request or handling the response.
AmazonServiceException - If any errors occurred in Amazon S3 while processing the request.

deleteBucketPolicy

public void deleteBucketPolicy(DeleteBucketPolicyRequest deleteBucketPolicyRequest)
                        throws AmazonClientException,
                               AmazonServiceException
Description copied from interface: AmazonS3

Deletes the policy associated with the specified bucket. Only the owner of the bucket can delete the bucket policy.

Bucket policies provide access control management at the bucket level for both the bucket resource and contained object resources. Only one policy can be specified per-bucket.

See the Amazon S3 developer guide for more information on forming bucket polices.

Specified by:
deleteBucketPolicy in interface AmazonS3
Parameters:
deleteBucketPolicyRequest - The request object containing all the details for deleting a bucket's policy.
Throws:
AmazonClientException - If any errors are encountered in the client while making the request or handling the response.
AmazonServiceException - If any errors occurred in Amazon S3 while processing the request.

generatePresignedUrl

public URL generatePresignedUrl(String bucketName,
                                String key,
                                Date expiration)
                         throws AmazonClientException
Description copied from interface: AmazonS3

Returns a pre-signed URL for accessing an Amazon S3 resource.

Pre-signed URLs allow clients to form a URL for an Amazon S3 resource, and then sign it with the current AWS security credentials. The pre-signed URL can be shared to other users, allowing access to the resource without providing an account's AWS security credentials.

Pre-signed URLs are useful in many situations where AWS security credentials aren't available from the client that needs to make the actual request to Amazon S3.

For example, an application may need remote users to upload files to the application owner's Amazon S3 bucket, but doesn't need to ship the AWS security credentials with the application. A pre-signed URL to PUT an object into the owner's bucket can be generated from a remote location with the owner's AWS security credentials, then the pre-signed URL can be passed to the end user's application to use.

Specified by:
generatePresignedUrl in interface AmazonS3
Parameters:
bucketName - The name of the bucket containing the desired object.
key - The key in the specified bucket under which the desired object is stored.
expiration - The time at which the returned pre-signed URL will expire.
Returns:
A pre-signed URL which expires at the specified time, and can be used to allow anyone to download the specified object from S3, without exposing the owner's AWS secret access key.
Throws:
AmazonClientException - If there were any problems pre-signing the request for the specified S3 object.
See Also:
AmazonS3.generatePresignedUrl(String, String, Date, HttpMethod), AmazonS3.generatePresignedUrl(GeneratePresignedUrlRequest)

generatePresignedUrl

public URL generatePresignedUrl(String bucketName,
                                String key,
                                Date expiration,
                                HttpMethod method)
                         throws AmazonClientException
Description copied from interface: AmazonS3

Returns a pre-signed URL for accessing an Amazon S3 resource.

Pre-signed URLs allow clients to form a URL for an Amazon S3 resource, and then sign it with the current AWS security credentials. The pre-signed URL can be shared to other users, allowing access to the resource without providing an account's AWS security credentials.

Pre-signed URLs are useful in many situations where AWS security credentials aren't available from the client that needs to make the actual request to Amazon S3.

For example, an application may need remote users to upload files to the application owner's Amazon S3 bucket, but doesn't need to ship the AWS security credentials with the application. A pre-signed URL to PUT an object into the owner's bucket can be generated from a remote location with the owner's AWS security credentials, then the pre-signed URL can be passed to the end user's application to use.

Specified by:
generatePresignedUrl in interface AmazonS3
Parameters:
bucketName - The name of the bucket containing the desired object.
key - The key in the specified bucket under which the desired object is stored.
expiration - The time at which the returned pre-signed URL will expire.
method - The HTTP method verb to use for this URL
Returns:
A pre-signed URL which expires at the specified time, and can be used to allow anyone to download the specified object from S3, without exposing the owner's AWS secret access key.
Throws:
AmazonClientException - If there were any problems pre-signing the request for the specified S3 object.
See Also:
AmazonS3.generatePresignedUrl(String, String, Date), AmazonS3.generatePresignedUrl(GeneratePresignedUrlRequest)

generatePresignedUrl

public URL generatePresignedUrl(GeneratePresignedUrlRequest generatePresignedUrlRequest)
                         throws AmazonClientException
Description copied from interface: AmazonS3

Returns a pre-signed URL for accessing an Amazon S3 resource.

Pre-signed URLs allow clients to form a URL for an Amazon S3 resource, and then sign it with the current AWS security credentials. The pre-signed URL can be shared to other users, allowing access to the resource without providing an account's AWS security credentials.

Pre-signed URLs are useful in many situations where AWS security credentials aren't available from the client that needs to make the actual request to Amazon S3.

For example, an application may need remote users to upload files to the application owner's Amazon S3 bucket, but doesn't need to ship the AWS security credentials with the application. A pre-signed URL to PUT an object into the owner's bucket can be generated from a remote location with the owner's AWS security credentials, then the pre-signed URL can be passed to the end user's application to use.

Note that presigned URLs cannot be used to upload an object with an attached policy, as described in this blog post. That method is only suitable for POSTs from HTML forms by browsers.

Specified by:
generatePresignedUrl in interface AmazonS3
Parameters:
generatePresignedUrlRequest - The request object containing all the options for generating a pre-signed URL (bucket name, key, expiration date, etc).
Returns:
A pre-signed URL that can be used to access an Amazon S3 resource without requiring the user of the URL to know the account's AWS security credentials.
Throws:
AmazonClientException - If there were any problems pre-signing the request for the Amazon S3 resource.
See Also:
AmazonS3.generatePresignedUrl(String, String, Date), AmazonS3.generatePresignedUrl(String, String, Date, HttpMethod)

abortMultipartUpload

public void abortMultipartUpload(AbortMultipartUploadRequest abortMultipartUploadRequest)
                          throws AmazonClientException,
                                 AmazonServiceException
Description copied from interface: AmazonS3
Aborts a multipart upload. After a multipart upload is aborted, no additional parts can be uploaded using that upload ID. The storage consumed by any previously uploaded parts will be freed. However, if any part uploads are currently in progress, those part uploads may or may not succeed. As a result, it may be necessary to abort a given multipart upload multiple times in order to completely free all storage consumed by all parts.

Specified by:
abortMultipartUpload in interface AmazonS3
Parameters:
abortMultipartUploadRequest - The AbortMultipartUploadRequest object that specifies all the parameters of this operation.
Throws:
AmazonClientException - If any errors are encountered in the client while making the request or handling the response.
AmazonServiceException - If any errors occurred in Amazon S3 while processing the request.

completeMultipartUpload

public CompleteMultipartUploadResult completeMultipartUpload(CompleteMultipartUploadRequest completeMultipartUploadRequest)
                                                      throws AmazonClientException,
                                                             AmazonServiceException
Description copied from interface: AmazonS3
Completes a multipart upload by assembling previously uploaded parts.

You first upload all parts using the AmazonS3.uploadPart(UploadPartRequest) method. After successfully uploading all individual parts of an upload, you call this operation to complete the upload. Upon receiving this request, Amazon S3 concatenates all the parts in ascending order by part number to create a new object. In the CompleteMultipartUpload request, you must provide the parts list. For each part in the list, you provide the part number and the ETag header value, returned after that part was uploaded.

Processing of a CompleteMultipartUpload request may take several minutes to complete.

Specified by:
completeMultipartUpload in interface AmazonS3
Parameters:
completeMultipartUploadRequest - The CompleteMultipartUploadRequest object that specifies all the parameters of this operation.
Returns:
A CompleteMultipartUploadResult from S3 containing the ETag for the new object composed of the individual parts.
Throws:
AmazonClientException - If any errors are encountered in the client while making the request or handling the response.
AmazonServiceException - If any errors occurred in Amazon S3 while processing the request.

initiateMultipartUpload

public InitiateMultipartUploadResult initiateMultipartUpload(InitiateMultipartUploadRequest initiateMultipartUploadRequest)
                                                      throws AmazonClientException,
                                                             AmazonServiceException
Description copied from interface: AmazonS3
Initiates a multipart upload and returns an InitiateMultipartUploadResult which contains an upload ID. This upload ID associates all the parts in the specific upload and is used in each of your subsequent AmazonS3.uploadPart(UploadPartRequest) requests. You also include this upload ID in the final request to either complete, or abort the multipart upload request.

Note: After you initiate a multipart upload and upload one or more parts, you must either complete or abort the multipart upload in order to stop getting charged for storage of the uploaded parts. Once you complete or abort the multipart upload Amazon S3 will release the stored parts and stop charging you for their storage.

Specified by:
initiateMultipartUpload in interface AmazonS3
Parameters:
initiateMultipartUploadRequest - The InitiateMultipartUploadRequest object that specifies all the parameters of this operation.
Returns:
An InitiateMultipartUploadResult from Amazon S3.
Throws:
AmazonClientException - If any errors are encountered in the client while making the request or handling the response.
AmazonServiceException - If any errors occurred in Amazon S3 while processing the request.

listMultipartUploads

public MultipartUploadListing listMultipartUploads(ListMultipartUploadsRequest listMultipartUploadsRequest)
                                            throws AmazonClientException,
                                                   AmazonServiceException
Description copied from interface: AmazonS3
Lists in-progress multipart uploads. An in-progress multipart upload is a multipart upload that has been initiated, using the InitiateMultipartUpload request, but has not yet been completed or aborted.

This operation returns at most 1,000 multipart uploads in the response by default. The number of multipart uploads can be further limited using the MaxUploads property on the request parameter. If there are additional multipart uploads that satisfy the list criteria, the response will contain an IsTruncated property with the value set to true. To list the additional multipart uploads use the KeyMarker and UploadIdMarker properties on the request parameters.

Specified by:
listMultipartUploads in interface AmazonS3
Parameters:
listMultipartUploadsRequest - The ListMultipartUploadsRequest object that specifies all the parameters of this operation.
Returns:
A MultipartUploadListing from Amazon S3.
Throws:
AmazonClientException - If any errors are encountered in the client while making the request or handling the response.
AmazonServiceException - If any errors occurred in Amazon S3 while processing the request.

listParts

public PartListing listParts(ListPartsRequest listPartsRequest)
                      throws AmazonClientException,
                             AmazonServiceException
Description copied from interface: AmazonS3
Lists the parts that have been uploaded for a specific multipart upload.

This method must include the upload ID, returned by the AmazonS3.initiateMultipartUpload(InitiateMultipartUploadRequest) operation. This request returns a maximum of 1000 uploaded parts by default. You can restrict the number of parts returned by specifying the MaxParts property on the ListPartsRequest. If your multipart upload consists of more parts than allowed in the ListParts response, the response returns a IsTruncated field with value true, and a NextPartNumberMarker property. In subsequent ListParts request you can include the PartNumberMarker property and set its value to the NextPartNumberMarker property value from the previous response.

Specified by:
listParts in interface AmazonS3
Parameters:
listPartsRequest - The ListPartsRequest object that specifies all the parameters of this operation.
Returns:
Returns a PartListing from Amazon S3.
Throws:
AmazonClientException - If any errors are encountered in the client while making the request or handling the response.
AmazonServiceException - If any errors occurred in Amazon S3 while processing the request.

uploadPart

public UploadPartResult uploadPart(UploadPartRequest uploadPartRequest)
                            throws AmazonClientException,
                                   AmazonServiceException
Description copied from interface: AmazonS3
Uploads a part in a multipart upload. You must initiate a multipart upload before you can upload any part.

Your UploadPart request must include an upload ID and a part number. The upload ID is the ID returned by Amazon S3 in response to your Initiate Multipart Upload request. Part number can be any number between 1 and 10,000, inclusive. A part number uniquely identifies a part and also defines its position within the object being uploaded. If you upload a new part using the same part number that was specified in uploading a previous part, the previously uploaded part is overwritten.

To ensure data is not corrupted traversing the network, specify the Content-MD5 header in the Upload Part request. Amazon S3 checks the part data against the provided MD5 value. If they do not match, Amazon S3 returns an error.

When you upload a part, the returned UploadPartResult contains an ETag property. You should record this ETag property value and the part number. After uploading all parts, you must send a CompleteMultipartUpload request. At that time Amazon S3 constructs a complete object by concatenating all the parts you uploaded, in ascending order based on the part numbers. The CompleteMultipartUpload request requires you to send all the part numbers and the corresponding ETag values.

Note: After you initiate a multipart upload and upload one or more parts, you must either complete or abort the multipart upload in order to stop getting charged for storage of the uploaded parts. Once you complete or abort the multipart upload Amazon S3 will release the stored parts and stop charging you for their storage.

Specified by:
uploadPart in interface AmazonS3
Parameters:
uploadPartRequest - The UploadPartRequest object that specifies all the parameters of this operation.
Returns:
An UploadPartResult from Amazon S3 containing the part number and ETag of the new part.
Throws:
AmazonClientException - If any errors are encountered in the client while making the request or handling the response.
AmazonServiceException - If any errors occurred in Amazon S3 while processing the request.

getCachedResponseMetadata

public S3ResponseMetadata getCachedResponseMetadata(AmazonWebServiceRequest request)
Description copied from interface: AmazonS3
Gets additional metadata for a previously executed successful request. The returned metadata is typically used for debugging issues when a service isn't acting as expected. This data isn't considered part of the result data returned by an operation; as so, it's available through this separate diagnostic interface.

Response metadata is only cached for a limited period of time. Use this method to retrieve the response metadata as soon as possible after executing a request.

Specified by:
getCachedResponseMetadata in interface AmazonS3
Parameters:
request - The originally executed request.
Returns:
The response metadata for the specified request, or null if none is available.

restoreObject

public void restoreObject(RestoreObjectRequest restoreObjectRequest)
                   throws AmazonServiceException
Description copied from interface: AmazonS3
Restore an object, which was transitioned to Amazon Glacier from Amazon S3 when it was expired, into Amazon S3 again. This copy is by nature temporary and is always stored as RRS in Amazon S3. The customer will be able to set / re-adjust the lifetime of this copy. By re-adjust we mean the customer can call this API to shorten or extend the lifetime of the copy. Note the request will only be accepted when there is no ongoing restore request. One needs to have the new s3:RestoreObject permission to perform this operation.

Specified by:
restoreObject in interface AmazonS3
Throws:
AmazonServiceException - If any errors occurred in Amazon S3 while processing the request.
See Also:
restoreObject(String, String, int)

restoreObject

public void restoreObject(String bucketName,
                          String key,
                          int expirationInDays)
                   throws AmazonServiceException
(non-Javadoc)

Specified by:
restoreObject in interface AmazonS3
Parameters:
bucketName - The name of an existing bucket.
key - The key under which to store the specified file.
expirationInDays - The number of days after which the object will expire.
Throws:
AmazonServiceException - If any errors occurred in Amazon S3 while processing the request.
See Also:
com.amazonaws.services.s3.AmazonS3#copyGlacierObject((java.lang.String, java.lang.String, int)

getResourceUrl

public String getResourceUrl(String bucketName,
                             String key)
Returns the URL to the key in the bucket given, using the client's scheme and endpoint. Returns null if the given bucket and key cannot be converted to a URL.


getUrl

public URL getUrl(String bucketName,
                  String key)
Returns an URL for the object stored in the specified bucket and key.

If the object identified by the given bucket and key has public read permissions (ex: CannedAccessControlList.PublicRead), then this URL can be directly accessed to retrieve the object's data.

Parameters:
bucketName - The name of the bucket containing the object whose URL is being requested.
key - The key under which the object whose URL is being requested is stored.
Returns:
A unique URL for the object stored in the specified bucket and key.

getRegion

public Region getRegion()

enableRequesterPays

public void enableRequesterPays(String bucketName)
Description copied from interface: AmazonS3
Allows Amazon S3 bucket owner to enable the Requester Pays for the given bucket name. If enabled, the requester of an Amazon S3 object in the bucket is charged for the downloading the data from the bucket.

If a bucket is enabled for Requester Pays, then any attempt to read an object from it without Requester Pays enabled in getObject will result in a 403 error and the bucket owner will be charged for the request.

Enabling Requester Pays disables the ability to have anonymous access to this bucket

For more information on Requester pays, @see http://docs.aws.amazon.com/AmazonS3/latest/dev/RequesterPaysBuckets.html

Specified by:
enableRequesterPays in interface AmazonS3
Parameters:
bucketName - The name of the bucket being enabled for Requester Pays.
See Also:
AmazonS3.disableRequesterPays(String), AmazonS3.isRequesterPaysEnabled(String)

disableRequesterPays

public void disableRequesterPays(String bucketName)
Description copied from interface: AmazonS3
Allows Amazon S3 bucket owner to disable the Requester Pays for the given bucket name. Note:

If a bucket is enabled for Requester Pays, then any attempt to read an object from it without Requester Pays enabled in getObject will result in a 403 error and the bucket owner will be charged for the request.

Enabling Requester Pays disables the ability to have anonymous access to this bucket

For more information on Requester pays, @see http://docs.aws.amazon.com/AmazonS3/latest/dev/RequesterPaysBuckets.html

Specified by:
disableRequesterPays in interface AmazonS3
Parameters:
bucketName - The name of bucket being disabled for Requester Pays.
See Also:
AmazonS3.enableRequesterPays(String), AmazonS3.isRequesterPaysEnabled(String)

isRequesterPaysEnabled

public boolean isRequesterPaysEnabled(String bucketName)
Description copied from interface: AmazonS3
Retrieves the Requester Pays configuration associated with an Amazon S3 bucket. Note:

If a bucket is enabled for Requester Pays, then any attempt to read an object from it without Requester Pays enabled will result in a 403 error and the bucket owner will be charged for the request.

Enabling Requester Pays disables the ability to have anonymous access to this bucket.

For more information on Requester pays, @see http://docs.aws.amazon.com/AmazonS3/latest/dev/RequesterPaysBuckets.html

Specified by:
isRequesterPaysEnabled in interface AmazonS3
Parameters:
bucketName - The name of the bucket being checked for Requester Pays.
Returns:
true if the bucket is enabled for Requester Pays else false.
See Also:
AmazonS3.enableRequesterPays(String), AmazonS3.disableRequesterPays(String)


Copyright © 2010 Amazon Web Services, Inc. All Rights Reserved.