@NotThreadSafe @Path(value="s3") @Produces(value="application/xml") @Consumes(value={"text/xml","application/xml"}) 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 servlet@PUT @Path(value="{bucket}/") public javax.ws.rs.core.Response createBucket(@PathParam(value="bucket") String bucket)
bucket
- the bucket name@DELETE @Path(value="{bucket}/") public javax.ws.rs.core.Response deleteBucket(@PathParam(value="bucket") String bucket)
bucket
- the bucket name@GET @Path(value="{bucket}/") public javax.ws.rs.core.Response getBucket(@PathParam(value="bucket") String bucket, @QueryParam(value="continuation-token") String continuationToken, @QueryParam(value="max-keys") String maxKeys, @QueryParam(value="prefix") String prefix)
bucket
- the bucket namecontinuationToken
- the optional continuation token parammaxKeys
- the optional max keys paramprefix
- the optional prefix param@PUT @Path(value="{bucket}/{object:.+}") @Consumes(value="*/*") public javax.ws.rs.core.Response createObjectOrUploadPart(@HeaderParam(value="Content-MD5") String contentMD5, @PathParam(value="bucket") String bucket, @PathParam(value="object") String object, @QueryParam(value="partNumber") Integer partNumber, @QueryParam(value="uploadId") 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 body@POST @Path(value="{bucket}/{object:.+}") public javax.ws.rs.core.Response initiateOrCompleteMultipartUpload(@PathParam(value="bucket") String bucket, @PathParam(value="object") String object, @QueryParam(value="uploads") String uploads, @QueryParam(value="uploadId") 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 completed@HEAD @Path(value="{bucket}/{object:.+}") public javax.ws.rs.core.Response getObjectMetadata(@PathParam(value="bucket") String bucket, @PathParam(value="object") String object)
bucket
- the bucket nameobject
- the object name@GET @Path(value="{bucket}/{object:.+}") @Produces(value={"application/xml","application/octet-stream"}) public javax.ws.rs.core.Response getObjectOrListParts(@PathParam(value="bucket") String bucket, @PathParam(value="object") String object, @QueryParam(value="uploadId") Long uploadId)
bucket
- the bucket nameobject
- the object nameuploadId
- the ID of the multipart upload, if not null, listing parts of the object@DELETE @Path(value="{bucket}/{object:.+}") public javax.ws.rs.core.Response deleteObjectOrAbortMultipartUpload(@PathParam(value="bucket") String bucket, @PathParam(value="object") String object, @QueryParam(value="uploadId") 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.