Class UploadManager
- java.lang.Object
-
- com.oracle.bmc.objectstorage.transfer.UploadManager
-
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 usingMultipartObjectAssembler
directly.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
UploadManager.UploadRequest
static class
UploadManager.UploadResponse
The result referencing the uploaded object.
-
Constructor Summary
Constructors Constructor Description UploadManager(ObjectStorage objectStorage, UploadConfiguration uploadConfiguration)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected MultipartObjectAssembler
createAssembler(PutObjectRequest request, UploadManager.UploadRequest uploadRequest, ExecutorService executorService)
UploadManager.UploadResponse
upload(UploadManager.UploadRequest uploadDetails)
Initiates a new upload request.
-
-
-
Constructor Detail
-
UploadManager
@ConstructorProperties({"objectStorage","uploadConfiguration"}) public UploadManager(ObjectStorage objectStorage, UploadConfiguration uploadConfiguration)
-
-
Method Detail
-
upload
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).
- Parameters:
uploadDetails
- The upload request.- Returns:
- The response.
- Throws:
BmcException
- if the upload fails for any reason.
-
createAssembler
protected MultipartObjectAssembler createAssembler(PutObjectRequest request, UploadManager.UploadRequest uploadRequest, ExecutorService executorService)
-
-