public class UploadManager extends Object
UploadManager simplifies interaction with the Object Storage service by abstracting away the method used to upload objects. Depending on the configuration parameters, UploadManager may choose to do a single PutObject request, or break up the upload into multiple parts and utilize multi-part uploads.
An advantage of using multi-part uploads is the ability to retry individual failed parts, as well as being able to upload parts in parallel to reduce upload time.
Callers still have full control over how the UploadManager decides to perform the upload using
UploadConfiguration
. Callers who want even more control, or need to combine multiple
files should look at using MultipartObjectAssembler
directly.
Modifier and Type | Class and Description |
---|---|
static class |
UploadManager.UploadRequest |
static class |
UploadManager.UploadResponse
The result referencing the uploaded object.
|
Constructor and Description |
---|
UploadManager(ObjectStorage objectStorage,
UploadConfiguration uploadConfiguration) |
Modifier and Type | Method and Description |
---|---|
protected MultipartObjectAssembler |
createAssembler(PutObjectRequest request,
UploadManager.UploadRequest uploadRequest,
ExecutorService executorService) |
UploadManager.UploadResponse |
upload(UploadManager.UploadRequest uploadDetails)
Initiates a new upload request.
|
@ConstructorProperties(value={"objectStorage","uploadConfiguration"}) public UploadManager(ObjectStorage objectStorage, UploadConfiguration uploadConfiguration)
public UploadManager.UploadResponse upload(UploadManager.UploadRequest uploadDetails)
Initiates a new upload request. The upload manager will decide whether to use a single
PutObject call or multi-part uploads depending on the UploadConfiguration
specified.
Note, if multi-part is used, no MD5 will be returned in the response. Also, if a multi-part upload attempt fails, the UploadManager will attempt to abort the upload to avoid leaving partially complete uploads and parts (unless explicitly disabled via UploadConfiguration).
uploadDetails
- The upload request.BmcException
- if the upload fails for any reason.protected MultipartObjectAssembler createAssembler(PutObjectRequest request, UploadManager.UploadRequest uploadRequest, ExecutorService executorService)
Copyright © 2016–2024. All rights reserved.