Class MultipartService

java.lang.Object
com.adobe.testing.s3mock.service.MultipartService

public class MultipartService extends Object
  • Constructor Details

  • 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 upload
      key - of the object to upload
      uploadId - id of the upload
      partNumber - number of the part to store
      inputStream - file data to be stored
      useV4ChunkedWithSigningFormat - If true, 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

      public ListPartsResult getMultipartUploadParts(String bucketName, String key, String uploadId)
      Get all multipart upload parts.
      Parameters:
      bucketName - name of the bucket
      key - object key
      uploadId - upload identifier
      Returns:
      List of Parts
    • abortMultipartUpload

      public void abortMultipartUpload(String bucketName, String key, String uploadId)
      Aborts the upload.
      Parameters:
      bucketName - to which was uploaded
      key - which was uploaded
      uploadId - 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 in
      key - object to upload
      contentType - the content type
      storeHeaders - various headers to store
      uploadId - id of the upload
      owner - owner of the upload
      initiator - initiator of the upload
      userMetadata - custom metadata
      Returns:
      upload result
    • listMultipartUploads

      public ListMultipartUploadsResult listMultipartUploads(String bucketName, String prefix)
      Lists all not-yet completed parts of multipart uploads in a bucket.
      Parameters:
      bucketName - the bucket to use as a filter
      prefix - the prefix use as a filter
      Returns:
      the list of not-yet completed multipart uploads.
    • verifyPartNumberLimits

      public void verifyPartNumberLimits(String partNumberString)
    • verifyMultipartParts

      public void verifyMultipartParts(String bucketName, String key, String uploadId, List<CompletedPart> requestedParts) throws S3Exception
      Throws:
      S3Exception
    • verifyMultipartParts

      public void verifyMultipartParts(String bucketName, UUID id, String uploadId) throws S3Exception
      Throws:
      S3Exception
    • verifyMultipartUploadExists

      public void verifyMultipartUploadExists(String uploadId) throws S3Exception
      Throws:
      S3Exception