public interface S3Client
ExecutionException
as documented in
Future.get()
.Modifier and Type | Method and Description |
---|---|
boolean |
bucketExists(String bucketName)
Issues a HEAD command to determine if the bucket exists or not.
|
ObjectMetadata |
copyObject(String sourceBucket,
String sourceObject,
String destinationBucket,
String destinationObject,
CopyObjectOptions... options)
Copies one object to another bucket, retaining UserMetadata from the source.
|
boolean |
deleteBucketIfEmpty(String bucketName)
Deletes the bucket, if it is empty.
|
void |
deleteObject(String bucketName,
String key)
Removes the object and metadata associated with the key.
|
void |
disableBucketLogging(String bucketName)
Disables logging for a bucket.
|
void |
enableBucketLogging(String bucketName,
BucketLogging logging)
Enables logging for a bucket.
|
AccessControlList |
getBucketACL(String bucketName)
A GET request operation directed at an object or bucket URI with the "acl" parameter retrieves
the Access Control List (ACL) settings for that S3 item.
|
String |
getBucketLocation(String bucketName)
A GET location request operation using a bucket URI lists the location constraint of the
bucket.
|
BucketLogging |
getBucketLogging(String bucketName)
Inspects the logging status for a bucket.
|
Payer |
getBucketPayer(String bucketName)
A GET request operation on a requestPayment resource returns the request payment configuration
of a bucket.
|
S3Object |
getObject(String bucketName,
String key,
GetOptions... options)
Retrieves the S3Object associated with the Key or KeyNotFoundException if not available;
To use GET, you must have READ access to the object.
|
AccessControlList |
getObjectACL(String bucketName,
String key)
A GET request operation directed at an object or bucket URI with the "acl" parameter retrieves
the Access Control List (ACL) settings for that S3 item.
|
ObjectMetadata |
headObject(String bucketName,
String key)
Retrieves the
metadata of
the object associated with the key or
org.jclouds.s3.domain.internal.BucketListObjectMetadata#NOT_FOUND if not
available. |
ListBucketResponse |
listBucket(String bucketName,
ListBucketOptions... options)
Retrieve a
S3Bucket listing. |
Set<BucketMetadata> |
listOwnedBuckets()
Returns a list of all of the buckets owned by the authenticated sender of the request.
|
S3Object |
newS3Object()
Creates a default implementation of S3Object
|
boolean |
objectExists(String bucketName,
String key) |
boolean |
putBucketACL(String bucketName,
AccessControlList acl)
Update a bucket's Access Control List settings.
|
boolean |
putBucketInRegion(String region,
String bucketName,
PutBucketOptions... options)
Create and name your own bucket in which to store your objects.
|
String |
putObject(String bucketName,
S3Object object,
PutObjectOptions... options)
Store data by creating or overwriting an object.
|
boolean |
putObjectACL(String bucketName,
String key,
AccessControlList acl)
Update an object's Access Control List settings.
|
void |
setBucketPayer(String bucketName,
Payer payer)
The PUT request operation with a requestPayment URI configures an existing bucket to be
Requester Pays or not.
|
@Provides S3Object newS3Object()
S3Object getObject(String bucketName, String key, GetOptions... options)
GetObjectOptions
to control delivery of content.
GetObjectOptions#range
GetObjectOptions#startAt
GetObjectOptions#tail
S3AsyncClient
interface}.bucketName
- namespace of the object you are retrievingkey
- unique key in the s3Bucket identifying the objectS3Object#NOT_FOUND
if not present.HttpResponseException
- if the conditions requested set were not satisfied by the object on the server.#getObject(String, String)
,
GetObjectOptions
ObjectMetadata headObject(String bucketName, String key)
metadata
of
the object associated with the key or
org.jclouds.s3.domain.internal.BucketListObjectMetadata#NOT_FOUND
if not
available.
The HEAD operation is used to retrieve information about a specific object or object size,
without actually fetching the object itself. This is useful if you're only interested in the
object metadata, and don't want to waste bandwidth on the object data.void deleteObject(String bucketName, String key)
bucketName
- namespace of the object you are deletingkey
- unique key in the s3Bucket identifying the objectHttpResponseException
- if the bucket is not availableString putObject(String bucketName, S3Object object, PutObjectOptions... options)
private
This returns a byte[] of the eTag hash of what Amazon S3 received
S3AsyncClient
interface}.bucketName
- namespace of the object you are storingobject
- contains the data and metadata to create or overwriteoptions
- options for creating the objectHttpResponseException
- if the conditions requested set are not satisfied by the object on the server.CannedAccessPolicy.PRIVATE
,
boolean putBucketInRegion(@Nullable String region, String bucketName, PutBucketOptions... options)
PutBucketOptions
to create the bucket in EU.
The PUT request operation with a bucket URI creates a new bucket. Depending on your latency
and legal requirements, you can specify a location constraint that will affect where your data
physically resides. You can currently specify a Europe (EU) location constraint via
PutBucketOptions
.options
- for creating your bucketPutBucketOptions
,
boolean deleteBucketIfEmpty(String bucketName)
boolean bucketExists(String bucketName)
ListBucketResponse listBucket(String bucketName, ListBucketOptions... options)
S3Bucket
listing. A GET request operation using a bucket URI lists
information about the objects in the bucket. You can use ListBucketOptions
to control
the amount of S3Objects to return.
To list the keys of a bucket, you must have READ access to the bucket.
bucketName
- namespace of the objects you wish to listBoundedList#NOT_FOUND
if not present.ListBucketOptions
,
Set<BucketMetadata> listOwnedBuckets()
ObjectMetadata copyObject(String sourceBucket, String sourceObject, String destinationBucket, String destinationObject, CopyObjectOptions... options)
specify new
metadata
. However, the ACL is not preserved and is set to private for the user making the
request. To override the default ACL setting,
specify a
new ACL
when generating a copy request.HttpResponseException
- if the conditions requested set are not satisfied by the object on the server.org.jclouds.s3.commands.CopyObject
,
,
CopyObjectOptions
,
CannedAccessPolicy
AccessControlList getBucketACL(String bucketName)
boolean putBucketACL(String bucketName, AccessControlList acl)
AccessControlList getObjectACL(String bucketName, String key)
boolean putObjectACL(String bucketName, String key, AccessControlList acl)
bucket
- the bucket containing the object to be updatedobjectKey
- the key of the object whose Access Control List settings will be updated.acl
- the ACL to apply to the object. This acl object mustAccessControlList.getOwner()
.String getBucketLocation(String bucketName)
Payer getBucketPayer(String bucketName)
void setBucketPayer(String bucketName, Payer payer)
BucketLogging getBucketLogging(String bucketName)
void enableBucketLogging(String bucketName, BucketLogging logging)
void disableBucketLogging(String bucketName)
Copyright © 2009-2012 jclouds. All Rights Reserved.