Package com.adobe.testing.s3mock
Class MultipartController
java.lang.Object
com.adobe.testing.s3mock.MultipartController
@CrossOrigin(origins="*",
exposedHeaders="*")
@RequestMapping("${com.adobe.testing.s3mock.contextPath:}")
public class MultipartController
extends Object
Handles requests related to parts.
-
Constructor Summary
ConstructorsConstructorDescriptionMultipartController(BucketService bucketService, ObjectService objectService, MultipartService multipartService) -
Method Summary
Modifier and TypeMethodDescriptionorg.springframework.http.ResponseEntity<Void>abortMultipartUpload(String bucketName, ObjectKey key, String uploadId) Aborts a multipart upload for a given uploadId.org.springframework.http.ResponseEntity<CompleteMultipartUploadResult>completeMultipartUpload(String bucketName, ObjectKey key, String uploadId, CompleteMultipartUpload upload, javax.servlet.http.HttpServletRequest request, org.springframework.http.HttpHeaders httpHeaders) Adds an object to a bucket.org.springframework.http.ResponseEntity<InitiateMultipartUploadResult>createMultipartUpload(String bucketName, ObjectKey key, String contentType, org.springframework.http.HttpHeaders httpHeaders) Initiates a multipart upload accepting encryption headers.org.springframework.http.ResponseEntity<ListMultipartUploadsResult>listMultipartUploads(String bucketName, String prefix) Lists all in-progress multipart uploads.org.springframework.http.ResponseEntity<ListPartsResult>Lists all parts a file multipart upload.org.springframework.http.ResponseEntity<Void>uploadPart(String bucketName, ObjectKey key, String uploadId, String partNumber, String sha256Header, org.springframework.http.HttpHeaders httpHeaders, InputStream inputStream) Adds an object to a bucket accepting encryption headers.org.springframework.http.ResponseEntity<CopyPartResult>uploadPartCopy(String bucketName, ObjectKey key, CopySource copySource, org.springframework.http.HttpRange copyRange, List<String> match, List<String> noneMatch, String uploadId, String partNumber, org.springframework.http.HttpHeaders httpHeaders) Uploads a part by copying data from an existing object as data source.
-
Constructor Details
-
MultipartController
public MultipartController(BucketService bucketService, ObjectService objectService, MultipartService multipartService)
-
-
Method Details
-
listMultipartUploads
@RequestMapping(value={"/{bucketName:.+}","/{bucketName:.+}/"}, params="uploads", method=GET, produces="application/xml") public org.springframework.http.ResponseEntity<ListMultipartUploadsResult> listMultipartUploads(@PathVariable String bucketName, @RequestParam(required=false) String prefix) Lists all in-progress multipart uploads. API ReferenceNot yet supported request parameters: delimiter, encoding-type, max-uploads, key-marker, upload-id-marker.
- Parameters:
bucketName- the Bucket in which to store the file in.- Returns:
- the
ListMultipartUploadsResult
-
abortMultipartUpload
@RequestMapping(value="/{bucketName:.+}/{*key}", params={"uploadId","!lifecycle"}, method=DELETE) public org.springframework.http.ResponseEntity<Void> abortMultipartUpload(@PathVariable String bucketName, @PathVariable ObjectKey key, @RequestParam String uploadId) Aborts a multipart upload for a given uploadId. API Reference- Parameters:
bucketName- the Bucket in which to store the file in.uploadId- id of the upload. Has to match all other part's uploads.
-
listParts
@RequestMapping(value="/{bucketName:.+}/{*key}", params="uploadId", method=GET, produces="application/xml") public org.springframework.http.ResponseEntity<ListPartsResult> listParts(@PathVariable String bucketName, @PathVariable ObjectKey key, @RequestParam String uploadId) Lists all parts a file multipart upload. API Reference- Parameters:
bucketName- the Bucket in which to store the file in.uploadId- id of the upload. Has to match all other part's uploads.- Returns:
- the
ListPartsResult
-
uploadPart
@RequestMapping(value="/{bucketName:.+}/{*key}", params={"uploadId","partNumber"}, headers={"!x-amz-copy-source","!x-amz-copy-source-range"}, method=PUT) public org.springframework.http.ResponseEntity<Void> uploadPart(@PathVariable String bucketName, @PathVariable ObjectKey key, @RequestParam String uploadId, @RequestParam String partNumber, @RequestHeader(value="x-amz-content-sha256",required=false) String sha256Header, @RequestHeader org.springframework.http.HttpHeaders httpHeaders, InputStream inputStream) Adds an object to a bucket accepting encryption headers. API Reference- Parameters:
bucketName- the Bucket in which to store the file in.uploadId- id of the upload. Has to match all other part's uploads.partNumber- number of the part to upload.- Returns:
- the etag of the uploaded part.
-
uploadPartCopy
@RequestMapping(value="/{bucketName:.+}/{*key}", headers="x-amz-copy-source", params={"uploadId","partNumber"}, method=PUT, produces="application/xml") public org.springframework.http.ResponseEntity<CopyPartResult> uploadPartCopy(@PathVariable String bucketName, @PathVariable ObjectKey key, @RequestHeader("x-amz-copy-source") CopySource copySource, @RequestHeader(value="x-amz-copy-source-range",required=false) org.springframework.http.HttpRange copyRange, @RequestHeader(value="x-amz-copy-source-if-match",required=false) List<String> match, @RequestHeader(value="x-amz-copy-source-if-none-match",required=false) List<String> noneMatch, @RequestParam String uploadId, @RequestParam String partNumber, @RequestHeader org.springframework.http.HttpHeaders httpHeaders) Uploads a part by copying data from an existing object as data source. API Reference- Parameters:
copySource- References the Objects to be copied.copyRange- Defines the byte range for this part. Optional.uploadId- id of the upload. Has to match all other part's uploads.partNumber- number of the part to upload.- Returns:
- The etag of the uploaded part.
-
createMultipartUpload
@RequestMapping(value="/{bucketName:.+}/{*key}", params="uploads", method=POST, produces="application/xml") public org.springframework.http.ResponseEntity<InitiateMultipartUploadResult> createMultipartUpload(@PathVariable String bucketName, @PathVariable ObjectKey key, @RequestHeader(value="Content-Type",required=false) String contentType, @RequestHeader org.springframework.http.HttpHeaders httpHeaders) Initiates a multipart upload accepting encryption headers. API Reference- Parameters:
bucketName- the Bucket in which to store the file in.- Returns:
- the
InitiateMultipartUploadResult.
-
completeMultipartUpload
@RequestMapping(value="/{bucketName:.+}/{*key}", params="uploadId", method=POST, produces="application/xml") public org.springframework.http.ResponseEntity<CompleteMultipartUploadResult> completeMultipartUpload(@PathVariable String bucketName, @PathVariable ObjectKey key, @RequestParam String uploadId, @RequestBody CompleteMultipartUpload upload, javax.servlet.http.HttpServletRequest request, @RequestHeader org.springframework.http.HttpHeaders httpHeaders) Adds an object to a bucket. API Reference- Parameters:
bucketName- the Bucket in which to store the file in.uploadId- id of the upload. Has to match all other part's uploads.- Returns:
CompleteMultipartUploadResult
-