@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) |
javax.ws.rs.core.Response |
createObjectOrUploadPart(String authorization,
String contentMD5,
String copySource,
String decodedLength,
String contentLength,
String bucket,
String object,
Integer partNumber,
Long uploadId,
InputStream is) |
javax.ws.rs.core.Response |
deleteBucket(String authorization,
String bucket) |
javax.ws.rs.core.Response |
deleteObjectOrAbortMultipartUpload(String authorization,
String bucket,
String object,
Long uploadId) |
javax.ws.rs.core.Response |
getBucket(String authorization,
String bucket,
String markerParam,
String prefixParam,
String delimiterParam,
String encodingTypeParam,
int maxKeysParam,
int listTypeParam,
String continuationTokenParam,
String startAfterParam) |
javax.ws.rs.core.Response |
getObjectMetadata(String authorization,
String bucket,
String object) |
javax.ws.rs.core.Response |
getObjectOrListParts(String authorization,
String range,
String bucket,
String object,
Long uploadId) |
static String |
getUserFromAuthorization(String authorization)
Gets the user from the authorization header string for AWS Signature Version 4.
|
javax.ws.rs.core.Response |
initiateOrCompleteMultipartUpload(String authorization,
String bucket,
String object,
String uploads,
Long uploadId) |
javax.ws.rs.core.Response |
listAllMyBuckets(String authorization)
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 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, int maxKeysParam, int listTypeParam, String continuationTokenParam, String startAfterParam)
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 listObjectV2public 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(@HeaderParam(value="Authorization") String authorization, String bucket)
authorization
- header parameter authorizationbucket
- the bucket namepublic javax.ws.rs.core.Response deleteBucket(@HeaderParam(value="Authorization") String authorization, String bucket)
authorization
- header parameter authorizationbucket
- the bucket namepublic javax.ws.rs.core.Response createObjectOrUploadPart(@HeaderParam(value="Authorization") String authorization, @HeaderParam(value="Content-MD5") String contentMD5, @HeaderParam(value="x-amz-copy-source") String copySource, @HeaderParam(value="x-amz-decoded-content-length") String decodedLength, @HeaderParam(value="Content-Length") String contentLength, String bucket, String object, Integer partNumber, Long uploadId, InputStream is)
authorization
- header parameter authorizationcontentMD5
- the optional Base64 encoded 128-bit MD5 digest of the objectcopySource
- the source path to copy the new file fromdecodedLength
- the length of the content when in aws-chunked encodingcontentLength
- the total length 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 nullis
- the request bodypublic javax.ws.rs.core.Response initiateOrCompleteMultipartUpload(@HeaderParam(value="Authorization") String authorization, String bucket, String object, String uploads, Long uploadId)
authorization
- header parameter authorizationbucket
- 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 formsuploadId
- the ID of the multipart upload to be completedpublic 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, Long uploadId)
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 headerpublic javax.ws.rs.core.Response deleteObjectOrAbortMultipartUpload(@HeaderParam(value="Authorization") String authorization, String bucket, String object, Long uploadId)
authorization
- header parameter authorizationbucket
- the bucket nameobject
- the object nameuploadId
- the upload ID which identifies the incomplete multipart upload to be abortedCopyright © 2023. All Rights Reserved.