public class S3JerseyClient extends AbstractJerseyClient implements S3Client
This implementation uses the JAX-RS reference implementation (Jersey) as it's REST client. When sending or receiving data, the following content handlers are supported by default. Be sure to use the appropriate content-type associated with each object type or the handlers will not understand the request.
| Object Type (class) | Expected Content-Type(s) |
|---|---|
| byte[] | *any* |
| java.lang.String | *any* |
| java.io.File (send-only) | *any* |
| java.io.InputStream (send-only) | *any* |
| any annotated JAXB root element bean | text/xml, application/xml |
Also keep in mind that you can always send/receive byte[] and do your own conversion.
To use, simply pass a new S3Config object to the constructor like so:
// for client-side load balancing and direct connection to all nodes
// single-VDC (client will auto-discover the remaining nodes):
S3Config config1 = new S3Config(Protocol.HTTP, "10.10.10.11", "10.10.10.12");
// multiple VDCs (client will auto-discover remaining nodes in specified VDCs):
Vdc boston = new Vdc("10.10.10.11", "10.10.10.12").withName("Boston");
Vdc seattle = new Vdc("10.20.20.11", "10.20.20.12").withName("Seattle");
S3Config config2 = new S3Config(Protocol.HTTPS, boston, seattle);
// to use a load balancer will full wildcard DNS setup
S3Config config3 = new S3Config(new URI("https://s3.company.com")).withUseVHost(true);
// in all cases, you need to provide your credentials
configX.withIdentity("my_full_token_id").withSecretKey("my_secret_key");
S3Client s3Client = new S3JerseyClient(configX);
To create an object, simply pass the object in to one of the putObject methods. The object type must be one of the supported types above.
String stringContent = "Hello World!";
s3Client.putObject("my-bucket", "my-key", stringContent, "text/plain");
File fileContent = new File( "spreadsheet.xls" );
s3Client.putObject("my-bucket", "my-data", fileContent, "application/vnd.ms-excel");
byte[] binaryContent;
... // load binary content to store as an object
s3Client.putObject("my-bucket", "my-bits", binaryContent, null ); // default content-type is application/octet-stream
To read an object, specify the type of object you want to receive from a readObject method. The same rules apply to this type.
String stringContent = s3Client.readObject("my-bucket", "my-key", String.class);
byte[] fileContent = s3Client.readObject("my-bucket", "my-data", byte[].class);
// do something with file content (stream to client? save in local filesystem?)
byte[] binaryContent = s3Client.readObject("my-bucket", "my-bits", byte[].class);
Performance
If you are experiencing performance issues, you might try tuning Jersey's IO buffer size, which defaults to 8k.
System.setProperty(ReaderWriter.BUFFER_SIZE_SYSTEM_PROPERTY, "" + 128 * 1024); // 128k
You can also try using Jersey's URLConnectionClientHandler, but be aware that this handler does not support
Expect: 100-Continue behavior if that is important to you. You should also increase
http.maxConnections to match your thread count.
System.setProperty("http.maxConnections", "" + 32); // if you have 32 threads
S3Client s3Client = new S3JerseyClient(configX, new URLConnectionClientHandler());
| Modifier and Type | Field and Description |
|---|---|
protected com.sun.jersey.api.client.Client |
client |
protected com.emc.rest.smart.LoadBalancer |
loadBalancer |
protected S3Config |
s3Config |
protected S3Signer |
signer |
objectConfig| Constructor and Description |
|---|
S3JerseyClient(S3Config s3Config) |
S3JerseyClient(S3Config config,
com.sun.jersey.api.client.ClientHandler clientHandler)
Provide a specific Jersey ClientHandler implementation (default is ApacheHttpClient4Handler).
|
| Modifier and Type | Method and Description |
|---|---|
void |
abortMultipartUpload(AbortMultipartUploadRequest request) |
long |
appendObject(java.lang.String bucketName,
java.lang.String key,
java.lang.Object content)
Atomically appends to the end of object
key in bucket bucketName with
content and returns the starting offset of the append operation |
boolean |
bucketExists(java.lang.String bucketName)
Returns whether
bucketName exists in the user's namespace (or the configured namespace of the
client). |
CompleteMultipartUploadResult |
completeMultipartUpload(CompleteMultipartUploadRequest request) |
CopyObjectResult |
copyObject(CopyObjectRequest request)
Remotely copies an object using the parameters specified in
request |
CopyObjectResult |
copyObject(java.lang.String sourceBucketName,
java.lang.String sourceKey,
java.lang.String bucketName,
java.lang.String key)
Remotely copies object
sourceKey in bucket sourceBucketName to key in
bucketName |
CopyPartResult |
copyPart(CopyPartRequest request) |
CopyRangeResult |
copyRange(CopyRangeRequest request)
This API is an ECS extension API.
|
void |
createBucket(CreateBucketRequest request)
Creates a bucket using the parameters specified in
request |
void |
createBucket(java.lang.String bucketName)
Creates a bucket with the specified name in the default namespace and with the default replication group
|
void |
deleteBucket(DeleteBucketRequest request)
Deletes
bucketName. |
void |
deleteBucket(java.lang.String bucketName)
Deletes
bucketName. |
void |
deleteBucketCors(java.lang.String bucketName)
Removes the CORS configuration for
bucketName |
void |
deleteBucketLifecycle(java.lang.String bucketName)
Deletes the lifecycle configuration for
bucketName |
void |
deleteBucketPolicy(java.lang.String bucketName)
Deletes the bucket policy for
bucketName |
void |
deleteObject(DeleteObjectRequest request)
Deletes object using the parameters specified in
request |
void |
deleteObject(java.lang.String bucketName,
java.lang.String key)
Deletes object
key from bucket bucketName |
DeleteObjectsResult |
deleteObjects(DeleteObjectsRequest request)
Deletes objects using the parameters specified in
request |
void |
deleteObjectTagging(DeleteObjectTaggingRequest request) |
void |
deleteVersion(java.lang.String bucketName,
java.lang.String key,
java.lang.String versionId)
Delets version
versionId of object key in bucket bucketName. |
void |
destroy()
Destroy the client.
|
void |
enableObjectLock(java.lang.String bucketName)
Enable Object Lock for bucket
bucketName. |
protected <T> T |
executeRequest(com.sun.jersey.api.client.Client client,
ObjectRequest request,
java.lang.Class<T> responseType) |
void |
extendRetentionPeriod(java.lang.String bucketName,
java.lang.String key,
java.lang.Long period)
Extend retention
period(seconds) on object key in bucket bucketName. |
protected void |
finalize() |
AccessControlList |
getBucketAcl(java.lang.String bucketName)
Retrieves the ACL of
bucketName |
CorsConfiguration |
getBucketCors(java.lang.String bucketName)
Retrieves the CORS configuration for
bucketName. |
BucketDeletionStatus |
getBucketDeletionStatus(java.lang.String bucketName)
Gets status of background bucket cleanup tasks for
bucketName if present |
BucketInfo |
getBucketInfo(java.lang.String bucketName)
Gets information about a bucket
|
LifecycleConfiguration |
getBucketLifecycle(java.lang.String bucketName)
Retrieves the lifecycle configuration for
bucketName. |
LocationConstraint |
getBucketLocation(java.lang.String bucketName)
Gets the location of
bucketName. |
BucketPolicy |
getBucketPolicy(java.lang.String bucketName)
Gets the bucket policy for
bucketName |
VersioningConfiguration |
getBucketVersioning(java.lang.String bucketName)
Retrieves the versioning status of
bucketName (none, enabled or suspended) |
com.emc.rest.smart.LoadBalancer |
getLoadBalancer() |
<T> GetObjectResult<T> |
getObject(GetObjectRequest request,
java.lang.Class<T> objectType)
Gets an object using the parameters specified in
request. |
GetObjectResult<java.io.InputStream> |
getObject(java.lang.String bucketName,
java.lang.String key)
Gets object
key in bucket bucketName. |
AccessControlList |
getObjectAcl(GetObjectAclRequest request) |
AccessControlList |
getObjectAcl(java.lang.String bucketName,
java.lang.String key) |
ObjectLockLegalHold |
getObjectLegalHold(GetObjectLegalHoldRequest request)
Get Object Legal Hold configuration using parameters in
request. |
ObjectLockConfiguration |
getObjectLockConfiguration(java.lang.String bucketName)
Get the Object Lock configuration for bucket
bucketName. |
S3ObjectMetadata |
getObjectMetadata(GetObjectMetadataRequest request)
Gets metadata using the parameters specified in
request |
S3ObjectMetadata |
getObjectMetadata(java.lang.String bucketName,
java.lang.String key)
Gets metadata for object
key in bucket bucketName |
ObjectLockRetention |
getObjectRetention(GetObjectRetentionRequest request)
Get Object Lock Retention using parameters in
request. |
ObjectTagging |
getObjectTagging(GetObjectTaggingRequest request) |
java.net.URL |
getPresignedUrl(PresignedUrlRequest request)
Generates a pre-signed URL using the parameters specified in
request |
java.net.URL |
getPresignedUrl(java.lang.String bucketName,
java.lang.String key,
java.util.Date expirationTime)
Generates a pre-signed URL to read object
key in bucket bucketName. |
S3Config |
getS3Config() |
InitiateMultipartUploadResult |
initiateMultipartUpload(InitiateMultipartUploadRequest request) |
java.lang.String |
initiateMultipartUpload(java.lang.String bucketName,
java.lang.String key) |
MetadataSearchList |
listBucketMetadataSearchKeys(java.lang.String bucketName)
Lists the metadata search keys associated with the givne bucket.
|
ListBucketsResult |
listBuckets()
Lists the buckets owned by the user
|
ListBucketsResult |
listBuckets(ListBucketsRequest request)
List the buckets owned by the user using the parameters specified in
request |
ListDataNode |
listDataNodes()
Lists all of the data nodes in the current VDC
|
ListObjectsResult |
listMoreObjects(ListObjectsResult lastResult)
Gets the next page of objects using the results of a previous list-objects call
|
ListVersionsResult |
listMoreVersions(ListVersionsResult lastResult)
Gets the next page of object versions using the results of a previous list-versions call
|
ListMultipartUploadsResult |
listMultipartUploads(ListMultipartUploadsRequest request) |
ListMultipartUploadsResult |
listMultipartUploads(java.lang.String bucketName) |
ListObjectsResult |
listObjects(ListObjectsRequest request)
Lists objects in a bucket using parameters specified in
request |
ListObjectsResult |
listObjects(java.lang.String bucketName)
Lists all objects in
bucketName with no restrictions |
ListObjectsResult |
listObjects(java.lang.String bucketName,
java.lang.String prefix)
Lists objects in
bucketName that start with prefix |
ListPartsResult |
listParts(ListPartsRequest request) |
ListPartsResult |
listParts(java.lang.String bucketName,
java.lang.String key,
java.lang.String uploadId) |
MetadataSearchList |
listSystemMetadataSearchKeys()
Lists the system metadata search keys.
|
ListVersionsResult |
listVersions(ListVersionsRequest request)
Lists all versions of all objects in a bucket using the parameters specified in
request |
ListVersionsResult |
listVersions(java.lang.String bucketName,
java.lang.String prefix)
Lists all versions of all objects in
bucketName that start with prefix |
PingResponse |
pingNode(Protocol protocol,
java.lang.String host,
int port)
Issues an unauthenticated ping request to the given host using the given protocol and port.
|
PingResponse |
pingNode(java.lang.String host)
Issues an unauthenticated ping request to the specified host.
|
PutObjectResult |
putObject(PutObjectRequest request)
Creates or updates an object using the parameters specified in
request |
void |
putObject(java.lang.String bucketName,
java.lang.String key,
java.lang.Object content,
java.lang.String contentType)
Creates or overwrites an object in
bucketName named key containing content
and having contentType |
void |
putObject(java.lang.String bucketName,
java.lang.String key,
Range range,
java.lang.Object content)
Updates object
key in bucket bucketName at the specified byte range with
new content |
void |
putObjectTagging(PutObjectTaggingRequest request) |
QueryObjectsResult |
queryMoreObjects(QueryObjectsResult lastResult)
Gets the next page of objects using the results of a previous query-objects call
|
QueryObjectsResult |
queryObjects(QueryObjectsRequest request)
Queries objects in a bucket using parameters specified in
request |
<T> T |
readObject(java.lang.String bucketName,
java.lang.String key,
java.lang.Class<T> objectType)
Reads object
key in bucket bucketName and converts it to objectType,
provided the conversion is supported by the implementation. |
<T> T |
readObject(java.lang.String bucketName,
java.lang.String key,
java.lang.String versionId,
java.lang.Class<T> objectType)
Reads version
versionId of object key in bucket bucketName and converts
it to objectType, provided the conversion is supported by the implementation. |
java.io.InputStream |
readObjectStream(java.lang.String bucketName,
java.lang.String key,
Range range)
Reads
range bytes of object key in bucket bucketName as a stream. |
void |
setBucketAcl(SetBucketAclRequest request)
Sets the ACL of a bucket using parameters in
request |
void |
setBucketAcl(java.lang.String bucketName,
AccessControlList acl)
Sets the specified ACL on
bucketName |
void |
setBucketAcl(java.lang.String bucketName,
CannedAcl cannedAcl)
Sets the specified canned ACL on
bucketName |
void |
setBucketCors(java.lang.String bucketName,
CorsConfiguration corsConfiguration)
Sets the CORS configuration for
bucketName |
void |
setBucketLifecycle(java.lang.String bucketName,
LifecycleConfiguration lifecycleConfiguration)
Sets the lifecycle configuration for
bucketName |
void |
setBucketPolicy(java.lang.String bucketName,
BucketPolicy policy)
Sets the bucket policy for
bucketName |
void |
setBucketStaleReadAllowed(java.lang.String bucketName,
boolean staleReadAllowed)
Sets whether stale reads are allowed on
bucketName. |
void |
setBucketVersioning(java.lang.String bucketName,
VersioningConfiguration versioningConfiguration)
Enables or suspends versioning on
bucketName |
void |
setObjectAcl(SetObjectAclRequest request) |
void |
setObjectAcl(java.lang.String bucketName,
java.lang.String key,
AccessControlList acl) |
void |
setObjectAcl(java.lang.String bucketName,
java.lang.String key,
CannedAcl cannedAcl) |
void |
setObjectLegalHold(SetObjectLegalHoldRequest request)
Set Object Legal Hold configuration using parameters in
request. |
void |
setObjectLockConfiguration(java.lang.String bucketName,
ObjectLockConfiguration objectLockConfiguration)
Set Object Lock Configuration for bucket
bucketName using parameters in objectLockConfiguration. |
void |
setObjectMetadata(java.lang.String bucketName,
java.lang.String key,
S3ObjectMetadata objectMetadata)
Sets metadata on object
key in bucket bucketName |
void |
setObjectRetention(SetObjectRetentionRequest request)
Set Object Lock Retention using parameters in
request. |
void |
shutdown()
Deprecated.
(2.0.3) use destroy() instead
|
MultipartPartETag |
uploadPart(UploadPartRequest request) |
buildRequest, executeAndClose, executeRequest, fillResponseEntity, getObjectConfigprotected S3Config s3Config
protected com.sun.jersey.api.client.Client client
protected com.emc.rest.smart.LoadBalancer loadBalancer
protected S3Signer signer
public S3JerseyClient(S3Config s3Config)
public S3JerseyClient(S3Config config, com.sun.jersey.api.client.ClientHandler clientHandler)
protected void finalize()
throws java.lang.Throwable
finalize in class java.lang.Objectjava.lang.Throwablepublic void shutdown()
public void destroy()
This method must be called when there are not responses pending otherwise undefined behavior will occur.
The client must not be reused after this method is called otherwise undefined behavior will occur.
public com.emc.rest.smart.LoadBalancer getLoadBalancer()
public ListDataNode listDataNodes()
S3ClientlistDataNodes in interface S3Clientpublic PingResponse pingNode(java.lang.String host)
S3Clientpublic PingResponse pingNode(Protocol protocol, java.lang.String host, int port)
S3Clientpublic ListBucketsResult listBuckets()
S3ClientlistBuckets in interface S3Clientpublic ListBucketsResult listBuckets(ListBucketsRequest request)
S3ClientrequestlistBuckets in interface S3Clientpublic boolean bucketExists(java.lang.String bucketName)
S3ClientbucketName exists in the user's namespace (or the configured namespace of the
client). This call will return true if the bucket exists even if the user does not have access to the bucket. If
this call returns false, a subsequent call to createBucket with the same name should succeedbucketExists in interface S3Clientpublic void createBucket(java.lang.String bucketName)
S3ClientcreateBucket in interface S3Clientpublic void createBucket(CreateBucketRequest request)
S3ClientrequestcreateBucket in interface S3ClientCreateBucketRequestpublic BucketInfo getBucketInfo(java.lang.String bucketName)
S3ClientgetBucketInfo in interface S3Clientpublic void deleteBucket(java.lang.String bucketName)
S3ClientbucketName. The bucket must be empty of all objects and versions before it can be deleteddeleteBucket in interface S3Clientpublic void deleteBucket(DeleteBucketRequest request)
S3ClientbucketName. The bucket could contain objects and versions before it can be deleteddeleteBucket in interface S3Clientpublic BucketDeletionStatus getBucketDeletionStatus(java.lang.String bucketName)
S3ClientbucketName if presentgetBucketDeletionStatus in interface S3Clientpublic void setBucketAcl(java.lang.String bucketName,
AccessControlList acl)
S3ClientbucketNamesetBucketAcl in interface S3ClientAccessControlListpublic void setBucketAcl(java.lang.String bucketName,
CannedAcl cannedAcl)
S3ClientbucketNamesetBucketAcl in interface S3ClientCannedAclpublic void setBucketAcl(SetBucketAclRequest request)
S3ClientrequestsetBucketAcl in interface S3ClientSetBucketAclRequestpublic AccessControlList getBucketAcl(java.lang.String bucketName)
S3ClientbucketNamegetBucketAcl in interface S3ClientAccessControlListpublic void setBucketCors(java.lang.String bucketName,
CorsConfiguration corsConfiguration)
S3ClientbucketNamesetBucketCors in interface S3ClientCorsConfigurationpublic CorsConfiguration getBucketCors(java.lang.String bucketName)
S3ClientbucketName. If no CORS configuration exists for the specified
bucket, null is returnedgetBucketCors in interface S3ClientCorsConfigurationpublic void deleteBucketCors(java.lang.String bucketName)
S3ClientbucketNamedeleteBucketCors in interface S3Clientpublic void setBucketLifecycle(java.lang.String bucketName,
LifecycleConfiguration lifecycleConfiguration)
S3ClientbucketNamesetBucketLifecycle in interface S3ClientLifecycleConfigurationpublic LifecycleConfiguration getBucketLifecycle(java.lang.String bucketName)
S3ClientbucketName. If no lifecycle exists for the specified
bucket, null is returnedgetBucketLifecycle in interface S3ClientLifecycleConfigurationpublic void deleteBucketLifecycle(java.lang.String bucketName)
S3ClientbucketNamedeleteBucketLifecycle in interface S3Clientpublic void setBucketPolicy(java.lang.String bucketName,
BucketPolicy policy)
S3ClientbucketNamesetBucketPolicy in interface S3ClientBucketPolicypublic BucketPolicy getBucketPolicy(java.lang.String bucketName)
S3ClientbucketNamegetBucketPolicy in interface S3ClientBucketPolicypublic void deleteBucketPolicy(java.lang.String bucketName)
S3ClientbucketNamedeleteBucketPolicy in interface S3ClientBucketPolicypublic LocationConstraint getBucketLocation(java.lang.String bucketName)
S3ClientbucketName. This call will return the name of the primary VDC of the bucketgetBucketLocation in interface S3Clientpublic void setBucketVersioning(java.lang.String bucketName,
VersioningConfiguration versioningConfiguration)
S3ClientbucketNamesetBucketVersioning in interface S3Clientpublic VersioningConfiguration getBucketVersioning(java.lang.String bucketName)
S3ClientbucketName (none, enabled or suspended)getBucketVersioning in interface S3Clientpublic void setBucketStaleReadAllowed(java.lang.String bucketName,
boolean staleReadAllowed)
S3ClientbucketName. If true, during a temporary site outage (TSO),
objects in the bucket may still be read from secondary sites, but these reads are not guaranteed to be strongly
consistent (they may be stale if the primary site is inaccessible). Note that stale reads are not
supported on filesystem buckets.setBucketStaleReadAllowed in interface S3Clientpublic MetadataSearchList listSystemMetadataSearchKeys()
S3ClientlistSystemMetadataSearchKeys in interface S3Clientpublic MetadataSearchList listBucketMetadataSearchKeys(java.lang.String bucketName)
S3ClientlistBucketMetadataSearchKeys in interface S3Clientpublic QueryObjectsResult queryObjects(QueryObjectsRequest request)
S3ClientrequestqueryObjects in interface S3Clientpublic QueryObjectsResult queryMoreObjects(QueryObjectsResult lastResult)
S3ClientqueryMoreObjects in interface S3Clientpublic ListObjectsResult listObjects(java.lang.String bucketName)
S3ClientbucketName with no restrictionslistObjects in interface S3Clientpublic ListObjectsResult listObjects(java.lang.String bucketName, java.lang.String prefix)
S3ClientbucketName that start with prefixlistObjects in interface S3Clientpublic ListObjectsResult listObjects(ListObjectsRequest request)
S3ClientrequestlistObjects in interface S3Clientpublic ListObjectsResult listMoreObjects(ListObjectsResult lastResult)
S3ClientlistMoreObjects in interface S3Clientpublic ListVersionsResult listVersions(java.lang.String bucketName, java.lang.String prefix)
S3ClientbucketName that start with prefixlistVersions in interface S3Clientpublic ListVersionsResult listVersions(ListVersionsRequest request)
S3ClientrequestlistVersions in interface S3Clientpublic ListVersionsResult listMoreVersions(ListVersionsResult lastResult)
S3ClientlistMoreVersions in interface S3Clientpublic void putObject(java.lang.String bucketName,
java.lang.String key,
java.lang.Object content,
java.lang.String contentType)
S3ClientbucketName named key containing content
and having contentTypepublic void putObject(java.lang.String bucketName,
java.lang.String key,
Range range,
java.lang.Object content)
S3Clientkey in bucket bucketName at the specified byte range with
new contentpublic PutObjectResult putObject(PutObjectRequest request)
S3Clientrequestpublic long appendObject(java.lang.String bucketName,
java.lang.String key,
java.lang.Object content)
S3Clientkey in bucket bucketName with
content and returns the starting offset of the append operationappendObject in interface S3Clientpublic CopyObjectResult copyObject(java.lang.String sourceBucketName, java.lang.String sourceKey, java.lang.String bucketName, java.lang.String key)
S3ClientsourceKey in bucket sourceBucketName to key in
bucketNamecopyObject in interface S3Clientpublic CopyObjectResult copyObject(CopyObjectRequest request)
S3ClientrequestcopyObject in interface S3Clientpublic <T> T readObject(java.lang.String bucketName,
java.lang.String key,
java.lang.Class<T> objectType)
S3Clientkey in bucket bucketName and converts it to objectType,
provided the conversion is supported by the implementation.
Note: this method will return null for 304 and 412 responses (failed preconditions).
readObject in interface S3Clientpublic <T> T readObject(java.lang.String bucketName,
java.lang.String key,
java.lang.String versionId,
java.lang.Class<T> objectType)
S3ClientversionId of object key in bucket bucketName and converts
it to objectType, provided the conversion is supported by the implementation.
Note: this method will return null for 304 and 412 responses (failed preconditions).
readObject in interface S3Clientpublic java.io.InputStream readObjectStream(java.lang.String bucketName,
java.lang.String key,
Range range)
S3Clientrange bytes of object key in bucket bucketName as a stream.
Note: this method will return null for 304 and 412 responses (failed preconditions).
readObjectStream in interface S3Clientpublic GetObjectResult<java.io.InputStream> getObject(java.lang.String bucketName, java.lang.String key)
S3Clientkey in bucket bucketName. Object details as well as the data stream
(obtained from GetObjectResult.getObject() are contained in the GetObjectResult instance.
Note: this method will return null for 304 and 412 responses (failed preconditions).
This method will open a stream for the object data. Be sure to call getObject() and,
if requesting an InputStream, properly close the stream to release the connection.
public <T> GetObjectResult<T> getObject(GetObjectRequest request, java.lang.Class<T> objectType)
S3Clientrequest. Object details as well as the translated
data (converted to objectType) are contained in the GetObjectResult instance.
Note: this method will return null for 304 and 412 responses (failed preconditions).
This method will open a stream for the object data. Be sure to call getObject() and,
if requesting an InputStream, properly close the stream to release the connection.
public java.net.URL getPresignedUrl(java.lang.String bucketName,
java.lang.String key,
java.util.Date expirationTime)
S3Clientkey in bucket bucketName. The URL will be
valid until expirationTimegetPresignedUrl in interface S3Clientpublic java.net.URL getPresignedUrl(PresignedUrlRequest request)
S3ClientrequestgetPresignedUrl in interface S3Clientpublic void deleteObject(java.lang.String bucketName,
java.lang.String key)
S3Clientkey from bucket bucketNamedeleteObject in interface S3Clientpublic void deleteObject(DeleteObjectRequest request)
S3ClientrequestdeleteObject in interface S3Clientpublic void deleteVersion(java.lang.String bucketName,
java.lang.String key,
java.lang.String versionId)
S3ClientversionId of object key in bucket bucketName.
Note: versioning must be enabled in the bucket.
deleteVersion in interface S3Clientpublic DeleteObjectsResult deleteObjects(DeleteObjectsRequest request)
S3ClientrequestdeleteObjects in interface S3Clientpublic void setObjectMetadata(java.lang.String bucketName,
java.lang.String key,
S3ObjectMetadata objectMetadata)
S3Clientkey in bucket bucketNamesetObjectMetadata in interface S3Clientpublic S3ObjectMetadata getObjectMetadata(java.lang.String bucketName, java.lang.String key)
S3Clientkey in bucket bucketNamegetObjectMetadata in interface S3Clientpublic S3ObjectMetadata getObjectMetadata(GetObjectMetadataRequest request)
S3ClientrequestgetObjectMetadata in interface S3Clientpublic void setObjectAcl(java.lang.String bucketName,
java.lang.String key,
AccessControlList acl)
setObjectAcl in interface S3Clientpublic void setObjectAcl(java.lang.String bucketName,
java.lang.String key,
CannedAcl cannedAcl)
setObjectAcl in interface S3Clientpublic void setObjectAcl(SetObjectAclRequest request)
setObjectAcl in interface S3Clientpublic AccessControlList getObjectAcl(java.lang.String bucketName, java.lang.String key)
getObjectAcl in interface S3Clientpublic AccessControlList getObjectAcl(GetObjectAclRequest request)
getObjectAcl in interface S3Clientpublic void extendRetentionPeriod(java.lang.String bucketName,
java.lang.String key,
java.lang.Long period)
S3Clientperiod(seconds) on object key in bucket bucketName.
Note: New retention period value can only be increased. That is, it can be the same as the current or greater value.
If the new retention period value is -1, infinite retention applies on that object.extendRetentionPeriod in interface S3Clientpublic ListMultipartUploadsResult listMultipartUploads(java.lang.String bucketName)
listMultipartUploads in interface S3Clientpublic ListMultipartUploadsResult listMultipartUploads(ListMultipartUploadsRequest request)
listMultipartUploads in interface S3Clientpublic java.lang.String initiateMultipartUpload(java.lang.String bucketName,
java.lang.String key)
initiateMultipartUpload in interface S3Clientpublic InitiateMultipartUploadResult initiateMultipartUpload(InitiateMultipartUploadRequest request)
initiateMultipartUpload in interface S3Clientpublic ListPartsResult listParts(java.lang.String bucketName, java.lang.String key, java.lang.String uploadId)
public ListPartsResult listParts(ListPartsRequest request)
public MultipartPartETag uploadPart(UploadPartRequest request)
uploadPart in interface S3Clientpublic CopyPartResult copyPart(CopyPartRequest request)
public CompleteMultipartUploadResult completeMultipartUpload(CompleteMultipartUploadRequest request)
completeMultipartUpload in interface S3Clientpublic void abortMultipartUpload(AbortMultipartUploadRequest request)
abortMultipartUpload in interface S3Clientpublic void setObjectLockConfiguration(java.lang.String bucketName,
ObjectLockConfiguration objectLockConfiguration)
S3ClientbucketName using parameters in objectLockConfiguration.setObjectLockConfiguration in interface S3Clientpublic ObjectLockConfiguration getObjectLockConfiguration(java.lang.String bucketName)
S3ClientbucketName.
If Object Lock Configuration is not set, null is returned.getObjectLockConfiguration in interface S3Clientpublic void enableObjectLock(java.lang.String bucketName)
S3ClientbucketName.enableObjectLock in interface S3Clientpublic void setObjectLegalHold(SetObjectLegalHoldRequest request)
S3Clientrequest.setObjectLegalHold in interface S3Clientpublic ObjectLockLegalHold getObjectLegalHold(GetObjectLegalHoldRequest request)
S3Clientrequest.getObjectLegalHold in interface S3Clientpublic void setObjectRetention(SetObjectRetentionRequest request)
S3Clientrequest.setObjectRetention in interface S3Clientpublic ObjectLockRetention getObjectRetention(GetObjectRetentionRequest request)
S3Clientrequest.getObjectRetention in interface S3Clientpublic CopyRangeResult copyRange(CopyRangeRequest request)
S3Clientpublic ObjectTagging getObjectTagging(GetObjectTaggingRequest request)
getObjectTagging in interface S3Clientpublic void putObjectTagging(PutObjectTaggingRequest request)
putObjectTagging in interface S3Clientpublic void deleteObjectTagging(DeleteObjectTaggingRequest request)
deleteObjectTagging in interface S3Clientprotected <T> T executeRequest(com.sun.jersey.api.client.Client client,
ObjectRequest request,
java.lang.Class<T> responseType)
executeRequest in class AbstractJerseyClientpublic S3Config getS3Config()