@NotThreadSafe public final class S3RestServiceHandler extends Object
Modifier and Type | Field and Description |
---|---|
static String |
BUCKET_PARAM |
static String |
BUCKET_SEPARATOR
Bucket must be a directory directly under a mount point.
|
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 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) |
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.
|
public static final String SERVICE_PREFIX
public static final String BUCKET_SEPARATOR
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)
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 parampublic 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, 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 frombucket
- 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.