|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface S3Client
Provides access to S3 via their REST API.
All commands return a Future of the result from S3. Any exceptions incurred during processing will be wrapped in anExecutionException
as documented in
Future.get()
.
Method Summary | |
---|---|
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. |
Method Detail |
---|
@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 object
S3Object#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.
bucketName
- namespace of the metadata you are retrievingkey
- unique key in the s3Bucket identifying the object
org.jclouds.s3.domain.internal.BucketListObjectMetadata#NOT_FOUND
if not
present;#getObject(String, String)
,
boolean objectExists(String bucketName, String key)
void deleteObject(String bucketName, String key)
bucketName
- namespace of the object you are deletingkey
- unique key in the s3Bucket identifying the object
HttpResponseException
- 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 object
HttpResponseException
- 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 bucket
PutBucketOptions
,
boolean deleteBucketIfEmpty(String bucketName)
bucketName
- what to delete
org.jclouds.s3.commands.DeleteBucket
,
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 list
BoundedList#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)
bucketName
- the bucket whose Access Control List settings will be updated.acl
- the ACL to apply to the bucket. This acl object mustAccessControlList.getOwner()
.
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)
bucket
- the bucket you wish to know where exists
Payer getBucketPayer(String bucketName)
bucketName
- the bucket you wish to know the payer status
Payer.REQUESTER
for a Requester Pays bucket, and Payer.BUCKET_OWNER
,
for a normal bucket.void setBucketPayer(String bucketName, Payer payer)
bucketName
- the bucket you wish to know the payer statuspayer
- Payer.REQUESTER
for a Requester Pays bucket, and Payer.BUCKET_OWNER
,
for a normal bucket.BucketLogging getBucketLogging(String bucketName)
bucketName
- the bucket you wish to know the logging status
void enableBucketLogging(String bucketName, BucketLogging logging)
bucketName
- the bucket you wish to enable logging forlogging
- configuration including destination, prefix, and access rulesvoid disableBucketLogging(String bucketName)
bucketName
- the bucket you wish to disable logging for
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |