@NotThreadSafe public final class TransferManagerBuilder extends Object
TransferManager
. Use of the builder is preferred over constructors in
the TransferManager class.Modifier and Type | Method and Description |
---|---|
TransferManager |
build()
Construct a TransferManager with the default ExecutorService.
|
static TransferManager |
defaultTransferManager() |
ExecutorFactory |
getExecutorFactory() |
Long |
getMinimumUploadPartSize() |
Long |
getMultipartCopyPartSize() |
Long |
getMultipartCopyThreshold() |
Long |
getMultipartUploadThreshold() |
AmazonS3 |
getS3Client() |
Boolean |
isShutDownThreadPools() |
void |
setExecutorFactory(ExecutorFactory executorFactory)
Sets a new
ExecutorFactory for the builder. |
void |
setMinimumUploadPartSize(Long minimumUploadPartSize)
Sets the minimum part size for upload parts.
|
void |
setMultipartCopyPartSize(Long multipartCopyPartSize)
Sets the minimum size in bytes of each part when a multi-part copy operation is carried out.
|
void |
setMultipartCopyThreshold(Long multipartCopyThreshold)
Sets the size threshold, in bytes, for when to use multi-part copy.
|
void |
setMultipartUploadThreshold(Long multipartUploadThreshold)
Sets the size threshold, in bytes, for when to use multipart uploads.
|
void |
setS3Client(AmazonS3 s3Client)
Sets the low level client used to make the service calls to Amazon S3.
|
void |
setShutDownThreadPools(Boolean shutDownThreadPools)
By default, when the transfer manager is shut down, the underlying
ExecutorService is
also shut down. |
static TransferManagerBuilder |
standard() |
TransferManagerBuilder |
withExecutorFactory(ExecutorFactory executorFactory)
Sets a new
ExecutorFactory for the builder. |
TransferManagerBuilder |
withMinimumUploadPartSize(Long minimumUploadPartSize)
Sets the minimum part size for upload parts.
|
TransferManagerBuilder |
withMultipartCopyPartSize(Long multipartCopyPartSize)
Sets the minimum size in bytes of each part when a multi-part copy operation is carried out.
|
TransferManagerBuilder |
withMultipartCopyThreshold(Long multipartCopyThreshold)
Sets the size threshold, in bytes, for when to use multi-part copy.
|
TransferManagerBuilder |
withMultipartUploadThreshold(Long multipartUploadThreshold)
Sets the size threshold, in bytes, for when to use multipart uploads.
|
TransferManagerBuilder |
withS3Client(AmazonS3 s3Client)
Sets the low level client used to make the service calls to Amazon S3.
|
TransferManagerBuilder |
withShutDownThreadPools(Boolean shutDownThreadPools)
By default, when the transfer manager is shut down, the underlying
ExecutorService is
also shut down. |
public static TransferManagerBuilder standard()
public static TransferManager defaultTransferManager()
AmazonS3ClientBuilder
to create a default AmazonS3
client implementation.public final AmazonS3 getS3Client()
public final void setS3Client(AmazonS3 s3Client)
s3Client
- Client implementation to usepublic final TransferManagerBuilder withS3Client(AmazonS3 s3Client)
s3Client
- Client implementation to usepublic final ExecutorFactory getExecutorFactory()
ExecutorFactory
currently configured in the builder.public final void setExecutorFactory(ExecutorFactory executorFactory)
ExecutorFactory
for the builder. The factory is invoked for each transfer
manager created through the builder.executorFactory
- New executor factory to use.public final TransferManagerBuilder withExecutorFactory(ExecutorFactory executorFactory)
ExecutorFactory
for the builder. The factory is invoked for each transfer
manager created through the builder.executorFactory
- New executor factory to use.public final Boolean isShutDownThreadPools()
public final void setShutDownThreadPools(Boolean shutDownThreadPools)
ExecutorService
is
also shut down. For cases where the same thread pool is reused across different workloads you
can set this option to false to disable that behavior.shutDownThreadPools
- True to shut down thread pools on transfer manager shutdown, false
otherwise.public final TransferManagerBuilder withShutDownThreadPools(Boolean shutDownThreadPools)
ExecutorService
is
also shut down. For cases where the same thread pool is reused across different workloads you
can set this option to false to disable that behavior.shutDownThreadPools
- True to shut down thread pools on transfer manager shutdown, false
otherwise.public final Long getMinimumUploadPartSize()
public final void setMinimumUploadPartSize(Long minimumUploadPartSize)
minimumUploadPartSize
- New minimum threshold for upload part sizepublic final TransferManagerBuilder withMinimumUploadPartSize(Long minimumUploadPartSize)
minimumUploadPartSize
- New minimum threshold for upload part sizepublic final Long getMultipartUploadThreshold()
public final void setMultipartUploadThreshold(Long multipartUploadThreshold)
Multipart uploads are easier to recover from and also potentially faster than single part uploads, especially when the upload parts can be uploaded in parallel as with files. Because there is additional network communication, small uploads are still recommended to use a single connection for the upload.
multipartUploadThreshold
- Threshold in which multipart uploads will be performed.public final TransferManagerBuilder withMultipartUploadThreshold(Long multipartUploadThreshold)
Multipart uploads are easier to recover from and also potentially faster than single part uploads, especially when the upload parts can be uploaded in parallel as with files. Because there is additional network communication, small uploads are still recommended to use a single connection for the upload.
multipartUploadThreshold
- Threshold in which multipart uploads will be performed.public final Long getMultipartCopyThreshold()
public final void setMultipartCopyThreshold(Long multipartCopyThreshold)
multipartCopyThreshold
- Threshold in which multipart copies will be performed.public final TransferManagerBuilder withMultipartCopyThreshold(Long multipartCopyThreshold)
multipartCopyThreshold
- Threshold in which multipart copies will be performed.public final Long getMultipartCopyPartSize()
public final void setMultipartCopyPartSize(Long multipartCopyPartSize)
multipartCopyPartSize
- New minimum threshold for copy part sizepublic final TransferManagerBuilder withMultipartCopyPartSize(Long multipartCopyPartSize)
multipartCopyPartSize
- New minimum threshold for copy part sizepublic final TransferManager build()
Copyright © 2017. All rights reserved.