@NotThreadSafe public final class S3RestServiceHandler extends Object
Modifier and Type | Field and Description |
---|---|
static String |
BUCKET_PARAM |
static int |
BUCKET_PATH_CACHE_SIZE |
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 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 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 bucket,
String tagging,
String policy)
Deletes a bucket, or deletes all tags from an existing bucket.
|
javax.ws.rs.core.Response |
deleteObjectOrAbortMultipartUpload(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 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 bucket,
String object)
Retrieves an object's metadata.
|
javax.ws.rs.core.Response |
getObjectOrListParts(String range,
String bucket,
String object,
String uploadId,
String tagging,
String acl)
Downloads an object or list parts of the object in multipart upload.
|
javax.ws.rs.core.Response |
headBucket(String bucket)
HeadBucket - head a bucket to check for existence.
|
javax.ws.rs.core.Response |
initiateMultipartUpload(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()
Lists all buckets owned by you.
|
javax.ws.rs.core.Response |
postBucket(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 static final int BUCKET_PATH_CACHE_SIZE
public S3RestServiceHandler(@Context javax.servlet.ServletContext context) throws IOException, AlluxioException
S3RestServiceHandler
.context
- context for the servletIOException
AlluxioException
public javax.ws.rs.core.Response listAllMyBuckets()
public javax.ws.rs.core.Response headBucket(String bucket)
bucket
- public javax.ws.rs.core.Response getBucket(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)
bucket
- 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(String bucket, String delete, @HeaderParam(value="Content-Length") int contentLength, InputStream is)
bucket
- 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(String bucket, String tagging, String acl, String policy, InputStream is)
bucket
- 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(String bucket, String tagging, String policy)
bucket
- 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="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)
contentMD5
- 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="Content-Type") String contentType, String bucket, String object, String uploads, @HeaderParam(value="x-amz-tagging") String taggingHeader)
contentType
- 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(String bucket, String object)
bucket
- the bucket nameobject
- the object namepublic javax.ws.rs.core.Response getObjectOrListParts(@HeaderParam(value="Range") String range, String bucket, String object, String uploadId, String tagging, String acl)
bucket
- 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(String bucket, String object, String uploadId, String tagging)
bucket
- 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.