@NotThreadSafe public final class S3RestServiceHandler extends Object
Modifier and Type | Field and Description |
---|---|
static String |
BUCKET_PARAM |
static String |
OBJECT_PARAM |
static String |
SERVICE_PREFIX |
Constructor and Description |
---|
S3RestServiceHandler(javax.servlet.ServletContext context)
Constructs a new
S3RestServiceHandler . |
Modifier and Type | Method and Description |
---|---|
javax.ws.rs.core.Response |
createBucket(String authorization,
String bucket,
String tagging,
String acl,
String policy,
InputStream is)
Creates a bucket, or puts bucket tags on an existing bucket.
|
javax.ws.rs.core.Response |
createObjectOrUploadPart(String authorization,
String contentMD5,
String copySourceParam,
String decodedLength,
S3Constants.Directive metadataDirective,
String taggingHeader,
S3Constants.Directive taggingDirective,
String contentTypeParam,
String contentLength,
String bucket,
String object,
Integer partNumber,
String uploadId,
String tagging,
String acl,
InputStream is)
Uploads an object or part of an object in multipart upload.
|
javax.ws.rs.core.Response |
deleteBucket(String authorization,
String bucket,
String tagging,
String policy)
Deletes a bucket, or deletes all tags from an existing bucket.
|
javax.ws.rs.core.Response |
deleteObjectOrAbortMultipartUpload(String authorization,
String bucket,
String object,
String uploadId,
String tagging)
Deletes an object, an object's tags, or aborts a multipart upload.
|
javax.ws.rs.core.Response |
getBucket(String authorization,
String bucket,
String markerParam,
String prefixParam,
String delimiterParam,
String encodingTypeParam,
Integer maxKeysParam,
Integer listTypeParam,
String continuationTokenParam,
String startAfterParam,
String tagging,
String acl,
String policy,
String policyStatus,
String uploads)
Gets a bucket and lists all the objects or bucket tags in it.
|
javax.ws.rs.core.Response |
getObjectMetadata(String authorization,
String bucket,
String object)
Retrieves an object's metadata.
|
javax.ws.rs.core.Response |
getObjectOrListParts(String authorization,
String range,
String bucket,
String object,
String uploadId,
String tagging,
String acl)
Downloads an object or list parts of the object in multipart upload.
|
static String |
getUserFromAuthorization(String authorization)
Gets the user from the authorization header string for AWS Signature Version 4.
|
javax.ws.rs.core.Response |
initiateMultipartUpload(String authorization,
String contentType,
String bucket,
String object,
String uploads,
String taggingHeader)
Initiates or completes a multipart upload based on query parameters.
|
javax.ws.rs.core.Response |
listAllMyBuckets(String authorization)
Lists all buckets owned by you.
|
javax.ws.rs.core.Response |
postBucket(String authorization,
String bucket,
String delete,
int contentLength,
InputStream is)
Currently implements the DeleteObjects request type if the query parameter "delete" exists.
|
public static final String SERVICE_PREFIX
public static final String BUCKET_PARAM
public static final String OBJECT_PARAM
public S3RestServiceHandler(@Context javax.servlet.ServletContext context)
S3RestServiceHandler
.context
- context for the servletpublic static String getUserFromAuthorization(String authorization)
authorization
- the authorization header stringpublic javax.ws.rs.core.Response listAllMyBuckets(@HeaderParam(value="Authorization") String authorization)
authorization
- header parameter authorizationpublic javax.ws.rs.core.Response getBucket(@HeaderParam(value="Authorization") String authorization, String bucket, String markerParam, String prefixParam, String delimiterParam, String encodingTypeParam, Integer maxKeysParam, Integer listTypeParam, String continuationTokenParam, String startAfterParam, String tagging, String acl, String policy, String policyStatus, String uploads)
authorization
- header parameter authorizationbucket
- the bucket namemarkerParam
- the optional marker paramprefixParam
- the optional prefix paramdelimiterParam
- the optional delimiter paramencodingTypeParam
- optional encoding type parammaxKeysParam
- the optional max keys paramlistTypeParam
- if listObjectV2 requestcontinuationTokenParam
- the optional continuationToken param for listObjectV2startAfterParam
- the optional startAfter param for listObjectV2tagging
- query string to indicate if this is for GetBucketTaggingacl
- query string to indicate if this is for GetBucketAclpolicy
- query string to indicate if this is for GetBucketPolicypolicyStatus
- query string to indicate if this is for GetBucketPolicyStatusuploads
- query string to indicate if this is for ListMultipartUploadspublic javax.ws.rs.core.Response postBucket(@HeaderParam(value="Authorization") String authorization, String bucket, String delete, @HeaderParam(value="Content-Length") int contentLength, InputStream is)
authorization
- header parameter authorizationbucket
- the bucket namedelete
- the delete query parameter. Existence indicates to run the DeleteObjects implcontentLength
- body content lengthis
- the input stream to read the requestDeleteObjectsResult
if this was a DeleteObjects requestpublic javax.ws.rs.core.Response createBucket(@HeaderParam(value="Authorization") String authorization, String bucket, String tagging, String acl, String policy, InputStream is)
authorization
- header parameter authorizationbucket
- the bucket nametagging
- query string to indicate if this is for PutBucketTagging or notacl
- query string to indicate if this is for PutBucketAclpolicy
- query string to indicate if this is for PutBucketPolicyis
- the request bodypublic javax.ws.rs.core.Response deleteBucket(@HeaderParam(value="Authorization") String authorization, String bucket, String tagging, String policy)
authorization
- header parameter authorizationbucket
- the bucket nametagging
- query string to indicate if this is for DeleteBucketTagging or notpolicy
- query string to indicate if this is for DeleteBucketPolicy or notpublic javax.ws.rs.core.Response createObjectOrUploadPart(@HeaderParam(value="Authorization") String authorization, @HeaderParam(value="Content-MD5") String contentMD5, @HeaderParam(value="x-amz-copy-source") String copySourceParam, @HeaderParam(value="x-amz-decoded-content-length") String decodedLength, @HeaderParam(value="x-amz-metadata-directive") S3Constants.Directive metadataDirective, @HeaderParam(value="x-amz-tagging") String taggingHeader, @HeaderParam(value="x-amz-tagging-directive") S3Constants.Directive taggingDirective, @HeaderParam(value="Content-Type") String contentTypeParam, @HeaderParam(value="Content-Length") String contentLength, String bucket, String object, Integer partNumber, String uploadId, String tagging, String acl, InputStream is)
authorization
- header parameter authorizationcontentMD5
- the optional Base64 encoded 128-bit MD5 digest of the objectcopySourceParam
- the URL-encoded source path to copy the new file fromdecodedLength
- the length of the content when in aws-chunked encodingcontentLength
- the total length of the request bodycontentTypeParam
- the content type of the request bodybucket
- the bucket nameobject
- the object namepartNumber
- the identification of the part of the object in multipart upload,
otherwise nulluploadId
- the upload ID of the multipart upload, otherwise nullmetadataDirective
- one of COPY or REPLACE used for CopyObjecttagging
- query string to indicate if this is for PutObjectTagging or nottaggingDirective
- one of COPY or REPLACE used for CopyObjecttaggingHeader
- the URL-encoded user tags passed in the headeracl
- query string to indicate if this is for PutObjectAclis
- the request bodypublic javax.ws.rs.core.Response initiateMultipartUpload(@HeaderParam(value="Authorization") String authorization, @HeaderParam(value="Content-Type") String contentType, String bucket, String object, String uploads, @HeaderParam(value="x-amz-tagging") String taggingHeader)
authorization
- header parameter AuthorizationcontentType
- header parameter Content-Typebucket
- the bucket nameobject
- the object nameuploads
- the query parameter specifying that this request is to initiate a multipart
upload instead of uploading an object through HTTP multipart formstaggingHeader
- the URL-encoded metadata tags passed in the headerpublic javax.ws.rs.core.Response getObjectMetadata(@HeaderParam(value="Authorization") String authorization, String bucket, String object)
authorization
- header parameter authorizationbucket
- the bucket nameobject
- the object namepublic javax.ws.rs.core.Response getObjectOrListParts(@HeaderParam(value="Authorization") String authorization, @HeaderParam(value="Range") String range, String bucket, String object, String uploadId, String tagging, String acl)
authorization
- header parameter authorizationbucket
- the bucket nameobject
- the object nameuploadId
- the ID of the multipart upload, if not null, listing parts of the objectrange
- the http range headertagging
- query string to indicate if this is for GetObjectTagging or notacl
- query string to indicate if this is for GetObjectAcl or notpublic javax.ws.rs.core.Response deleteObjectOrAbortMultipartUpload(@HeaderParam(value="Authorization") String authorization, String bucket, String object, String uploadId, String tagging)
authorization
- header parameter authorizationbucket
- the bucket nameobject
- the object nametagging
- query string to indicate if this is for DeleteObjectTagging or notuploadId
- the upload ID which identifies the incomplete multipart upload to be abortedCopyright © 2023. All Rights Reserved.