public final class MultipartUtils extends Object
Modifier and Type | Field and Description |
---|---|
static long |
MiB |
Modifier and Type | Method and Description |
---|---|
static long |
calculatePartSize(UploadConfiguration config,
long contentLength)
Calculate the part size, in bytes, that should be used per multi-part upload part.
|
static boolean |
shouldCalculateAdditionalChecksum(UploadConfiguration config,
PutObjectRequest request)
Test whether or not the additional checksum value should be calculated for the given request
when issuing a single upload (non-multipart) request.
|
static boolean |
shouldCalculateMd5(UploadConfiguration config,
PutObjectRequest request)
Test whether or not the MD5 value should be calculated for the given request when issuing a
single upload (non-multipart) request.
|
static boolean |
shouldSetAdditionalChecksum(UploadConfiguration config,
PutObjectRequest request)
Determines whether an additional checksum value should be set for the given request.
|
static boolean |
shouldUseMultipart(UploadConfiguration config,
long contentLength)
Test whether an object of a given size is large enough to warrant using multi-part uploads.
|
public static final long MiB
public static boolean shouldUseMultipart(@Nonnull UploadConfiguration config, long contentLength)
Test whether an object of a given size is large enough to warrant using multi-part uploads.
config
- The configuration to use.contentLength
- The length of the object in bytes.public static long calculatePartSize(@Nonnull UploadConfiguration config, long contentLength)
Calculate the part size, in bytes, that should be used per multi-part upload part.
config
- The configuration to use.contentLength
- The length of the object in bytes.public static boolean shouldCalculateMd5(@Nonnull UploadConfiguration config, @Nonnull PutObjectRequest request)
Test whether or not the MD5 value should be calculated for the given request when issuing a single upload (non-multipart) request.
config
- The configuration to use.request
- The request being sent.public static boolean shouldCalculateAdditionalChecksum(@Nonnull UploadConfiguration config, @Nonnull PutObjectRequest request)
Test whether or not the additional checksum value should be calculated for the given request when issuing a single upload (non-multipart) request.
config
- The configuration to use.request
- The request being sent.public static boolean shouldSetAdditionalChecksum(@Nonnull UploadConfiguration config, @Nonnull PutObjectRequest request)
Determines whether an additional checksum value should be set for the given request.
This method covers the following cases:
config
- The configuration to use.request
- The request being sent.NullPointerException
- if config or request is null.IllegalArgumentException
- if both the configuration and the request have different
checksum algorithms.Copyright © 2016–2024. All rights reserved.