public class UploadOperations extends Object
| Constructor and Description |
|---|
UploadOperations() |
| Modifier and Type | Method and Description |
|---|---|
void |
abortMultipartUpload(S3Configuration configuration,
S3Connection connection,
String bucket,
String objectKey,
String uploadId,
org.mule.runtime.extension.api.runtime.process.CompletionCallback<Void,Void> callback)
This action aborts a multipart upload.
|
void |
completeMultipartUpload(S3Configuration configuration,
S3Connection connection,
String bucket,
String objectKey,
String uploadId,
List<ApiMultipartPart> completedParts,
ConditionalWrites conditionalWrites,
org.mule.runtime.extension.api.runtime.process.CompletionCallback<CompleteMultipartUploadResponse,Void> callback)
Completes a multipart upload by assembling previously uploaded parts.
|
void |
createMultipartUpload(S3Configuration configuration,
S3Connection connection,
String bucket,
String objectKey,
Map<String,String> metadata,
ApiObjectACL acl,
UploadMetadata uploadMetadata,
org.mule.runtime.extension.api.runtime.process.CompletionCallback<CreateMultipartUploadResponse,Void> callback)
This action initiates a multipart upload and returns an upload ID.
|
org.mule.runtime.extension.api.runtime.streaming.PagingProvider<S3Connection,ApiMultipartUpload> |
listMultipartUploads(S3Configuration configuration,
String bucket,
String prefix,
Integer pageSize,
String keyMarker,
String uploadId)
This action lists in-progress multipart uploads.
|
org.mule.runtime.extension.api.runtime.streaming.PagingProvider<S3Connection,ApiObjectPart> |
listParts(S3Configuration configuration,
String bucket,
String key,
String uploadId,
Integer pageSize,
Integer partNumberMarker)
Lists the parts that have been uploaded for a specific multipart upload.
|
void |
uploadPart(S3Configuration configuration,
S3Connection connection,
String bucket,
String objectKey,
String uploadId,
int partNumber,
InputStream content,
String contentMD5,
Long contentLength,
org.mule.runtime.extension.api.runtime.process.CompletionCallback<UploadPartResponse,Void> callback)
Uploads a part in a multipart upload.
|
void |
uploadPartCopy(S3Configuration configuration,
S3Connection connection,
String sourceBucket,
String sourceKey,
String destinationBucket,
String destinationKey,
String uploadId,
int partNumber,
ObjectMatchingConstraints objectMatchingConstraints,
String bytesRange,
org.mule.runtime.extension.api.runtime.process.CompletionCallback<UploadPartCopyResponse,Void> callback)
Uploads a part by copying data from an existing object as data source.
|
@Throws(value=S3ErrorProvider.class) @DisplayName(value="Create Multipart Upload") public void createMultipartUpload(@Config S3Configuration configuration, @Connection S3Connection connection, @DisplayName(value="Bucket name") String bucket, @DisplayName(value="Object key") String objectKey, @Optional @DisplayName(value="Object metadata") @NullSafe Map<String,String> metadata, @Summary(value="The canned ACL to apply to the object.") @Optional @DisplayName(value="Object ACL") ApiObjectACL acl, @ParameterGroup(name="Upload metadata") UploadMetadata uploadMetadata, org.mule.runtime.extension.api.runtime.process.CompletionCallback<CreateMultipartUploadResponse,Void> callback)
This action initiates a multipart upload and returns an upload ID. This upload ID is used to associate all of the parts in the specific multipart upload. You specify this upload ID in each of your subsequent upload part requests (see UploadPart ). You also include this upload ID in the final request to either complete or abort the multipart upload request.
For more information about multipart uploads, see Multipart upload overview.
If you have configured a lifecycle rule to abort incomplete multipart uploads, the upload must complete within the number of days specified in the bucket lifecycle configuration. Otherwise, the incomplete multipart upload becomes eligible for an abort action and Amazon S3 aborts the multipart upload. For more information, see Aborting Incomplete Multipart Uploads Using a Bucket Lifecycle Policy
For information about the permissions required to use the multipart upload API, see .
After you initiate a multipart upload and upload one or more parts, to stop being charged for storing the uploaded parts, you must either complete or abort the multipart upload. Amazon S3 frees up the space used to store the parts and stop charging you for storing them only after you either complete or abort a multipart upload.
configuration - - configuration usedconnection - - active connectionbucket - - the name of the bucket to which to initiate the uploadobjectKey - - object key for which the multipart upload is to be initiatedacl - - the canned ACL to apply to the object. Valid values are private | public-read | public-read-write | authenticated-read | aws-exec-read | bucket-owner-read | bucket-owner-full-controlmetadata - - object metadata@DisplayName(value="Complete Multipart Upload")
@Throws(value={NoSuchUploadErrorProvider.class,S3ErrorProvider.class})
public void completeMultipartUpload(@Config
S3Configuration configuration,
@Connection
S3Connection connection,
@DisplayName(value="Bucket name")
String bucket,
@DisplayName(value="Object key")
String objectKey,
@DisplayName(value="Upload Id")
String uploadId,
@Content
List<ApiMultipartPart> completedParts,
@ParameterGroup(name="Conditional Writes")
ConditionalWrites conditionalWrites,
org.mule.runtime.extension.api.runtime.process.CompletionCallback<CompleteMultipartUploadResponse,Void> callback)
Completes a multipart upload by assembling previously uploaded parts.
You first initiate the multipart upload and then upload all parts using the UploadPart operation.
After successfully uploading all relevant parts of an upload, you call this action to complete the upload. Upon receiving this request, Amazon S3 concatenates all the parts in ascending
order by part number to create a new object. In the Complete Multipart Upload request, you must provide the parts list. You must ensure that the parts list is complete.
This action concatenates the parts that you provide in the list. For each part in the list, you must provide the part number and the ETag value, returned after that part was uploaded.
Processing of a Complete Multipart Upload request could take several minutes to complete. After Amazon S3 begins processing the request, it sends an HTTP response header that specifies a 200 OK response. While processing is in progress, Amazon S3 periodically sends white space characters to keep the connection from timing out. Because a request could fail after the initial 200 OK response has been sent, it is important that you check the response body to determine whether the request succeeded.
Note that if CompleteMultipartUpload fails, applications should be prepared to retry the failed requests. For more information,
see Amazon S3 Error Best Practices.
For more information about multipart uploads, see Uploading Objects Using Multipart Upload.
For information about permissions required to use the multipart upload API, see Multipart Upload and Permissions.
configuration - - configuration usedconnection - - active connectionbucket - - name of the bucket to which the multipart upload was initiatedobjectKey - - object key for which the multipart upload was initiateduploadId - - ID for the initiated multipart uploadcompletedParts - - List of completed parts@Throws(value=S3ErrorProvider.class) @DisplayName(value="Upload Part") public void uploadPart(@Config S3Configuration configuration, @Connection S3Connection connection, @DisplayName(value="Bucket name") String bucket, @DisplayName(value="Object key") String objectKey, @DisplayName(value="Upload Id") String uploadId, @DisplayName(value="Part Number") int partNumber, @DisplayName(value="Content") InputStream content, @DisplayName(value="ContentMD5") @Optional String contentMD5, @DisplayName(value="Content Length") @Optional Long contentLength, org.mule.runtime.extension.api.runtime.process.CompletionCallback<UploadPartResponse,Void> callback)
Uploads a part in a multipart upload.
In this operation, you provide part data in your request. However, you have an option to specify your existing Amazon S3 object as a data source for the part you are uploading. To upload a part from an existing object, you use the UploadPartCopy operation.
You must initiate a multipart upload (see CreateMultipartUpload) before you can upload any part. In response to your initiate request, Amazon S3 returns an upload ID, a unique identifier, that you must include in your upload part request.
Part numbers can be any number from 1 to 10,000, inclusive. A part number uniquely identifies a part and also defines its position within the object being created. If you upload a new part using the same part number that was used with a previous part, the previously uploaded part is overwritten. Each part must be at least 5 MB in size, except the last part. There is no size limit on the last part of your multipart upload.
To ensure that data is not corrupted when traversing the network, specify the Content-MD5 header in the upload part request. Amazon S3 checks the part data against the provided MD5 value.
If they do not match, Amazon S3 returns an error.
Note: After you initiate multipart upload and upload one or more parts, you must either complete or abort multipart upload in order to stop getting charged for storage of the uploaded parts. Only after you either complete or abort multipart upload, Amazon S3 frees up the parts storage and stops charging you for the parts storage.
For more information on multipart uploads, go to Multipart Upload Overview in the Amazon S3 User Guide .
For information on the permissions required to use the multipart upload API, go to Multipart Upload and Permissions in the Amazon S3 User Guide.
configuration - - configuration usedconnection - - active connectionbucket - - The name of the bucket to which the multipart upload was initiatedobjectKey - - Object key for which the multipart upload was initiateduploadId - - Upload ID identifying the multipart upload whose part is being uploadedpartNumber - - Part number of part being uploaded. This is a positive integer between 1 and 10,000content - - Object datacontentMD5 - - The base64 encoded 128-bit MD5 digest of the associated object (content - not including headers) according to RFC 1864contentLength - - Size of the body in bytes. This parameter is useful when the size of the body cannot be determined automatically@Throws(value=S3ErrorProvider.class) @DisplayName(value="Upload Part Copy") public void uploadPartCopy(@Config S3Configuration configuration, @Connection S3Connection connection, @DisplayName(value="Source bucket name") String sourceBucket, @DisplayName(value="Source object key") String sourceKey, @DisplayName(value="Destination bucket name") String destinationBucket, @DisplayName(value="Destination object key") String destinationKey, @DisplayName(value="Upload Id") String uploadId, @DisplayName(value="Part number") int partNumber, @ParameterGroup(name="Source Object Matching Constraints") ObjectMatchingConstraints objectMatchingConstraints, @Example(value="bytes=0-9") @Optional @DisplayName(value="Bytes range") String bytesRange, org.mule.runtime.extension.api.runtime.process.CompletionCallback<UploadPartCopyResponse,Void> callback)
Uploads a part by copying data from an existing object as data source.
The minimum allowable part size for a multipart upload is 5 MB. For more information about multipart upload limits, go to Quick Facts in the Amazon S3 User Guide.
Instead of using an existing object as part data, you might use the UploadPart action and provide data in your request.
You must initiate a multipart upload before you can upload any part. In response to your initiate request. Amazon S3 returns a unique identifier, the upload ID, that you must include in your upload part request.
For more information about using the UploadPartCopy operation, see the following:
configuration - - configuration usedconnection - - active connectiondestinationBucket - - the bucket namedestinationKey - - object key for which the multipart upload was initiatedsourceBucket - - source bucketsourceKey - - source object keyuploadId - - upload ID identifying the multipart upload whose part is being copiedpartNumber - - part number of part being copied. This is a positive integer between 1 and 10,000objectMatchingConstraints - - source object matching constrainsbytesRange - - range of the bytes that will be copied from source object from first to last byte@DisplayName(value="Abort Multipart Upload")
@Throws(value={NoSuchUploadErrorProvider.class,S3ErrorProvider.class})
public void abortMultipartUpload(@Config
S3Configuration configuration,
@Connection
S3Connection connection,
@DisplayName(value="Bucket name")
String bucket,
@DisplayName(value="Object key")
String objectKey,
@DisplayName(value="Upload Id")
String uploadId,
org.mule.runtime.extension.api.runtime.process.CompletionCallback<Void,Void> callback)
This action aborts a multipart upload. After a multipart upload is aborted, no additional parts can be uploaded using that upload ID. The storage consumed by any previously uploaded parts will be freed. However, if any part uploads are currently in progress, those part uploads might or might not succeed. As a result, it might be necessary to abort a given multipart upload multiple times in order to completely free all storage consumed by all parts.
To verify that all parts have been removed, so you don't get charged for the part storage, you should call the ListParts action and ensure that the parts list is empty.
For information about permissions required to use the multipart upload, see Multipart Upload and Permissions.
configuration - - configuration usedconnection - - active connectionbucket - - The bucket name to which the upload was taking place.objectKey - - Key of the object for which the multipart upload was initiated.uploadId - - Upload ID that identifies the multipart upload.@DisplayName(value="List Multipart Uploads") public org.mule.runtime.extension.api.runtime.streaming.PagingProvider<S3Connection,ApiMultipartUpload> listMultipartUploads(@Config S3Configuration configuration, @DisplayName(value="Bucket name") String bucket, @Optional @DisplayName(value="Prefix") String prefix, @Optional @DisplayName(value="Page size") Integer pageSize, @Optional @DisplayName(value="Key marker") String keyMarker, @Optional @DisplayName(value="Upload Id marker") String uploadId)
This action lists in-progress multipart uploads. An in-progress multipart upload is a multipart upload that has been initiated using the Initiate Multipart Upload request, but has not yet been completed or aborted.
In the response, the uploads are sorted by key. If your application has initiated more than one multipart upload using the same object key, then uploads in the response are first sorted by key. Additionally, uploads are sorted in ascending order within each key by the upload initiation time.
For information on permissions required to use the multipart upload API, see Multipart Upload and Permissions.
configuration - - configuration used.bucket - - The name of the bucket to which the multipart upload was initiated.prefix - - limits the response to keys that begin with the specified prefix.pageSize - - sets the page size of the response. By default the page size is 1,000 objects.keyMarker - - specifies the key to start with when listing parts in a bucket.uploadId - - specifies the upload id to start with when listing parts in a bucket.@DisplayName(value="List Multipart Parts") public org.mule.runtime.extension.api.runtime.streaming.PagingProvider<S3Connection,ApiObjectPart> listParts(@Config S3Configuration configuration, @DisplayName(value="Bucket name") String bucket, @DisplayName(value="Object key") String key, @DisplayName(value="Upload id") String uploadId, @Optional @DisplayName(value="Page size") Integer pageSize, @Optional @DisplayName(value="Part number marker") Integer partNumberMarker)
Lists the parts that have been uploaded for a specific multipart upload. This operation must include the upload ID, which you obtain by sending the initiate multipart upload request (see CreateMultipartUpload).
configuration - - configuration used.bucket - - the name of the bucket to which the multipart upload was initiated.key - - object key for which the multipart upload was initiated.uploadId - - upload ID identifying the multipart upload whose parts are being listed.pageSize - - sets the page size of the response. By default the page size is 1,000 objects.partNumberMarker - - specifies the part after which listing should begin. Only parts with higher part numbers will be listed.Copyright © 2025 MuleSoft, Inc.. All rights reserved.