public class S3ClientFactory
extends java.lang.Object
AmazonS3
client factory class. Given AmazonS3URI
instances and the configuration of the system
this factory is expected to return a valid client instance for the S3 URI which can then be used to access that URI.Constructor and Description |
---|
S3ClientFactory(com.amazonaws.auth.AWSCredentialsProvider awsCredentialsProvider,
com.amazonaws.regions.AwsRegionProvider regionProvider,
org.springframework.core.env.Environment environment)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
com.amazonaws.services.s3.AmazonS3 |
getClient(com.amazonaws.services.s3.AmazonS3URI s3URI)
Get an
AmazonS3 client instance appropriate for the given AmazonS3URI . |
com.amazonaws.services.s3.transfer.TransferManager |
getTransferManager(com.amazonaws.services.s3.AmazonS3URI s3URI)
Get a
TransferManager instance for use with the given s3URI . |
public S3ClientFactory(com.amazonaws.auth.AWSCredentialsProvider awsCredentialsProvider, com.amazonaws.regions.AwsRegionProvider regionProvider, org.springframework.core.env.Environment environment)
awsCredentialsProvider
- The base AWS credentials provider to use for the generated S3 clientsregionProvider
- How this factory should determine the default Regions
environment
- The Spring application Environment
public com.amazonaws.services.s3.AmazonS3 getClient(com.amazonaws.services.s3.AmazonS3URI s3URI)
AmazonS3
client instance appropriate for the given AmazonS3URI
.s3URI
- The URI of the S3 resource this client is expected to access.public com.amazonaws.services.s3.transfer.TransferManager getTransferManager(com.amazonaws.services.s3.AmazonS3URI s3URI)
TransferManager
instance for use with the given s3URI
.s3URI
- The S3 URI this transfer manager will be interacting withTransferManager
backed by an appropriate S3 client for the given URI