@NotThreadSafe
@Path(value="s3")
@Produces(value="application/xml")
@Consumes(value={"text/xml","application/xml","application/octet-stream","application/x-www-form-urlencoded"})
public final class S3RestServiceHandler
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
BUCKET_PARAM |
static java.lang.String |
OBJECT_PARAM |
static java.lang.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(java.lang.String authorization,
java.lang.String bucket) |
javax.ws.rs.core.Response |
createObjectOrUploadPart(java.lang.String authorization,
java.lang.String contentMD5,
java.lang.String copySource,
java.lang.String decodedLength,
java.lang.String contentLength,
java.lang.String bucket,
java.lang.String object,
java.lang.Integer partNumber,
java.lang.Long uploadId,
java.io.InputStream is) |
javax.ws.rs.core.Response |
deleteBucket(java.lang.String authorization,
java.lang.String bucket) |
javax.ws.rs.core.Response |
deleteObjectOrAbortMultipartUpload(java.lang.String authorization,
java.lang.String bucket,
java.lang.String object,
java.lang.Long uploadId) |
javax.ws.rs.core.Response |
getBucket(java.lang.String authorization,
java.lang.String bucket,
java.lang.String markerParam,
java.lang.String prefixParam,
java.lang.String delimiterParam,
java.lang.String encodingTypeParam,
int maxKeysParam,
int listTypeParam,
java.lang.String continuationTokenParam,
java.lang.String startAfterParam) |
javax.ws.rs.core.Response |
getObjectMetadata(java.lang.String authorization,
java.lang.String bucket,
java.lang.String object) |
javax.ws.rs.core.Response |
getObjectOrListParts(java.lang.String authorization,
java.lang.String range,
java.lang.String bucket,
java.lang.String object,
java.lang.Long uploadId) |
static java.lang.String |
getUserFromAuthorization(java.lang.String authorization)
Gets the user from the authorization header string for AWS Signature Version 4.
|
javax.ws.rs.core.Response |
initiateOrCompleteMultipartUpload(java.lang.String authorization,
java.lang.String bucket,
java.lang.String object,
java.lang.String uploads,
java.lang.Long uploadId) |
javax.ws.rs.core.Response |
listAllMyBuckets(java.lang.String authorization)
Lists all buckets owned by you.
|
javax.ws.rs.core.Response |
postBucket(java.lang.String bucket,
java.lang.String delete,
int contentLength,
java.io.InputStream is)
Currently implements the DeleteObjects request type if the query parameter "delete" exists.
|
public static final java.lang.String SERVICE_PREFIX
public static final java.lang.String BUCKET_PARAM
public static final java.lang.String OBJECT_PARAM
public S3RestServiceHandler(@Context
javax.servlet.ServletContext context)
S3RestServiceHandler.context - context for the servletpublic static java.lang.String getUserFromAuthorization(java.lang.String authorization)
authorization - the authorization header string@GET
public javax.ws.rs.core.Response listAllMyBuckets(@HeaderParam(value="Authorization")
java.lang.String authorization)
authorization - header parameter authorization@GET
@Path(value="{bucket}/")
public javax.ws.rs.core.Response getBucket(@HeaderParam(value="Authorization")
java.lang.String authorization,
@PathParam(value="bucket")
java.lang.String bucket,
@QueryParam(value="marker")
java.lang.String markerParam,
@QueryParam(value="prefix")
java.lang.String prefixParam,
@QueryParam(value="delimiter")
java.lang.String delimiterParam,
@QueryParam(value="encoding-type")
java.lang.String encodingTypeParam,
@QueryParam(value="max-keys")
int maxKeysParam,
@QueryParam(value="list-type")
int listTypeParam,
@QueryParam(value="continuation-token")
java.lang.String continuationTokenParam,
@QueryParam(value="start-after")
java.lang.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 listObjectV2@POST
@Path(value="{bucket}/")
public javax.ws.rs.core.Response postBucket(@PathParam(value="bucket")
java.lang.String bucket,
@QueryParam(value="delete")
java.lang.String delete,
@HeaderParam(value="Content-Length")
int contentLength,
java.io.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 request@PUT
@Path(value="{bucket}/")
public javax.ws.rs.core.Response createBucket(@HeaderParam(value="Authorization")
java.lang.String authorization,
@PathParam(value="bucket")
java.lang.String bucket)
authorization - header parameter authorizationbucket - the bucket name@DELETE
@Path(value="{bucket}/")
public javax.ws.rs.core.Response deleteBucket(@HeaderParam(value="Authorization")
java.lang.String authorization,
@PathParam(value="bucket")
java.lang.String bucket)
authorization - header parameter authorizationbucket - the bucket name@PUT
@Path(value="{bucket}/{object:.+}")
@Consumes(value="*/*")
public javax.ws.rs.core.Response createObjectOrUploadPart(@HeaderParam(value="Authorization")
java.lang.String authorization,
@HeaderParam(value="Content-MD5")
java.lang.String contentMD5,
@HeaderParam(value="x-amz-copy-source")
java.lang.String copySource,
@HeaderParam(value="x-amz-decoded-content-length")
java.lang.String decodedLength,
@HeaderParam(value="Content-Length")
java.lang.String contentLength,
@PathParam(value="bucket")
java.lang.String bucket,
@PathParam(value="object")
java.lang.String object,
@QueryParam(value="partNumber")
java.lang.Integer partNumber,
@QueryParam(value="uploadId")
java.lang.Long uploadId,
java.io.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 body@POST
@Path(value="{bucket}/{object:.+}")
@Consumes(value={"application/octet-stream","application/xml"})
public javax.ws.rs.core.Response initiateOrCompleteMultipartUpload(@HeaderParam(value="Authorization")
java.lang.String authorization,
@PathParam(value="bucket")
java.lang.String bucket,
@PathParam(value="object")
java.lang.String object,
@QueryParam(value="uploads")
java.lang.String uploads,
@QueryParam(value="uploadId")
java.lang.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 completed@HEAD
@Path(value="{bucket}/{object:.+}")
public javax.ws.rs.core.Response getObjectMetadata(@HeaderParam(value="Authorization")
java.lang.String authorization,
@PathParam(value="bucket")
java.lang.String bucket,
@PathParam(value="object")
java.lang.String object)
authorization - header parameter authorizationbucket - 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(@HeaderParam(value="Authorization")
java.lang.String authorization,
@HeaderParam(value="Range")
java.lang.String range,
@PathParam(value="bucket")
java.lang.String bucket,
@PathParam(value="object")
java.lang.String object,
@QueryParam(value="uploadId")
java.lang.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 header@DELETE
@Path(value="{bucket}/{object:.+}")
public javax.ws.rs.core.Response deleteObjectOrAbortMultipartUpload(@HeaderParam(value="Authorization")
java.lang.String authorization,
@PathParam(value="bucket")
java.lang.String bucket,
@PathParam(value="object")
java.lang.String object,
@QueryParam(value="uploadId")
java.lang.Long uploadId)
authorization - header parameter authorizationbucket - the bucket nameobject - the object nameuploadId - the upload ID which identifies the incomplete multipart upload to be abortedCopyright © 2022. All Rights Reserved.