Package com.adobe.testing.s3mock.service
Class MultipartService
java.lang.Object
com.adobe.testing.s3mock.service.MultipartService
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidabortMultipartUpload(String bucketName, String key, String uploadId) Aborts the upload.completeMultipartUpload(String bucketName, String key, String uploadId, List<CompletedPart> parts, Map<String, String> encryptionHeaders, String location) Completes a Multipart Upload for the given ID.copyPart(String bucketName, String key, org.springframework.http.HttpRange copyRange, String partNumber, String destinationBucket, String destinationKey, String uploadId, Map<String, String> encryptionHeaders) Copies the range, define by from/to, from the S3 Object, identified by the given key to given destination into the given bucket.getMultipartUploadParts(String bucketName, String key, String uploadId) Get all multipart upload parts.listMultipartUploads(String bucketName, String prefix) Lists all not-yet completed parts of multipart uploads in a bucket.prepareMultipartUpload(String bucketName, String key, String contentType, Map<String, String> storeHeaders, String uploadId, Owner owner, Owner initiator, Map<String, String> userMetadata, Map<String, String> encryptionHeaders) Prepares everything to store an object uploaded as multipart upload.putPart(String bucketName, String key, String uploadId, String partNumber, InputStream inputStream, boolean useV4ChunkedWithSigningFormat, Map<String, String> encryptionHeaders) Uploads a part of a multipart upload.voidverifyMultipartParts(String bucketName, String key, String uploadId, List<CompletedPart> requestedParts) voidverifyMultipartParts(String bucketName, UUID id, String uploadId) voidverifyMultipartUploadExists(String uploadId) voidverifyPartNumberLimits(String partNumberString)
-
Constructor Details
-
MultipartService
-
-
Method Details
-
putPart
public String putPart(String bucketName, String key, String uploadId, String partNumber, InputStream inputStream, boolean useV4ChunkedWithSigningFormat, Map<String, String> encryptionHeaders) Uploads a part of a multipart upload.- Parameters:
bucketName- in which to uploadkey- of the object to uploaduploadId- id of the uploadpartNumber- number of the part to storeinputStream- file data to be storeduseV4ChunkedWithSigningFormat- Iftrue, V4-style signing is enabled.- Returns:
- the md5 digest of this part
-
copyPart
public CopyPartResult copyPart(String bucketName, String key, org.springframework.http.HttpRange copyRange, String partNumber, String destinationBucket, String destinationKey, String uploadId, Map<String, String> encryptionHeaders) Copies the range, define by from/to, from the S3 Object, identified by the given key to given destination into the given bucket.- Parameters:
bucketName- The source Bucket.key- Identifies the S3 Object.copyRange- Byte range to copy. Optional.partNumber- The part to copy.destinationBucket- The Bucket the target object (will) reside in.destinationKey- The target object key.uploadId- id of the upload.- Returns:
- etag of the uploaded file.
-
getMultipartUploadParts
Get all multipart upload parts.- Parameters:
bucketName- name of the bucketkey- object keyuploadId- upload identifier- Returns:
- List of Parts
-
abortMultipartUpload
Aborts the upload.- Parameters:
bucketName- to which was uploadedkey- which was uploadeduploadId- of the upload
-
completeMultipartUpload
public CompleteMultipartUploadResult completeMultipartUpload(String bucketName, String key, String uploadId, List<CompletedPart> parts, Map<String, String> encryptionHeaders, String location) Completes a Multipart Upload for the given ID.- Parameters:
bucketName- in which to upload.key- of the file to upload.uploadId- id of the upload.parts- to concatenate.location- the location link to embed in result- Returns:
- etag of the uploaded file.
-
prepareMultipartUpload
public InitiateMultipartUploadResult prepareMultipartUpload(String bucketName, String key, String contentType, Map<String, String> storeHeaders, String uploadId, Owner owner, Owner initiator, Map<String, String> userMetadata, Map<String, String> encryptionHeaders) Prepares everything to store an object uploaded as multipart upload.- Parameters:
bucketName- Bucket to upload object inkey- object to uploadcontentType- the content typestoreHeaders- various headers to storeuploadId- id of the uploadowner- owner of the uploadinitiator- initiator of the uploaduserMetadata- custom metadata- Returns:
- upload result
-
listMultipartUploads
Lists all not-yet completed parts of multipart uploads in a bucket.- Parameters:
bucketName- the bucket to use as a filterprefix- the prefix use as a filter- Returns:
- the list of not-yet completed multipart uploads.
-
verifyPartNumberLimits
-
verifyMultipartParts
public void verifyMultipartParts(String bucketName, String key, String uploadId, List<CompletedPart> requestedParts) throws S3Exception - Throws:
S3Exception
-
verifyMultipartParts
- Throws:
S3Exception
-
verifyMultipartUploadExists
- Throws:
S3Exception
-