@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 bucket) |
javax.ws.rs.core.Response |
createObjectOrUploadPart(String contentMD5,
String bucket,
String object,
Integer partNumber,
Long uploadId,
InputStream is) |
javax.ws.rs.core.Response |
deleteBucket(String bucket) |
javax.ws.rs.core.Response |
deleteObjectOrAbortMultipartUpload(String bucket,
String object,
Long uploadId) |
javax.ws.rs.core.Response |
getBucket(String bucket,
String continuationToken,
String maxKeys,
String prefix) |
javax.ws.rs.core.Response |
getObjectMetadata(String bucket,
String object) |
javax.ws.rs.core.Response |
getObjectOrListParts(String bucket,
String object,
Long uploadId) |
javax.ws.rs.core.Response |
initiateOrCompleteMultipartUpload(String bucket,
String object,
String uploads,
Long uploadId) |
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 javax.ws.rs.core.Response createBucket(String bucket)
bucket
- the bucket namepublic javax.ws.rs.core.Response deleteBucket(String bucket)
bucket
- the bucket namepublic javax.ws.rs.core.Response getBucket(String bucket, String continuationToken, String maxKeys, String prefix)
bucket
- the bucket namecontinuationToken
- the optional continuation token parammaxKeys
- the optional max keys paramprefix
- the optional prefix parampublic javax.ws.rs.core.Response createObjectOrUploadPart(@HeaderParam(value="Content-MD5") String contentMD5, String bucket, String object, Integer partNumber, Long uploadId, InputStream is)
contentMD5
- the optional Base64 encoded 128-bit MD5 digest of the objectbucket
- 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(String bucket, String object, String uploads, Long uploadId)
bucket
- 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(String bucket, String object)
bucket
- the bucket nameobject
- the object namepublic javax.ws.rs.core.Response getObjectOrListParts(String bucket, String object, Long uploadId)
bucket
- the bucket nameobject
- the object nameuploadId
- the ID of the multipart upload, if not null, listing parts of the objectpublic javax.ws.rs.core.Response deleteObjectOrAbortMultipartUpload(String bucket, String object, Long uploadId)
bucket
- the bucket nameobject
- the object nameuploadId
- the upload ID which identifies the incomplete multipart upload to be abortedCopyright © 2023. All Rights Reserved.