Modifier and Type | Class and Description |
---|---|
static interface |
S3Utils.SliceConsumer
Represents an operation that accepts a slice number and a slice begin and end position.
|
Modifier and Type | Field and Description |
---|---|
static long |
NON_MULTIPART_COPY_MAX_SIZE
The maximum size of a file that can be copied without using multipart: 5 GB
|
static long |
PART_SIZE
The size of the parts that we use for multipart copy.
|
Modifier and Type | Method and Description |
---|---|
static com.amazonaws.services.s3.model.ObjectMetadata |
copyFile(com.amazonaws.services.s3.AmazonS3 amazonS3,
com.amazonaws.services.s3.model.ObjectMetadata objectMetadata,
String sourceBucket,
String sourceKey,
String targetBucket,
String targetKey,
boolean deleteSource)
Copies a file without using multipart upload.
|
static com.amazonaws.services.s3.model.ObjectMetadata |
copyFileMultipart(com.amazonaws.services.s3.AmazonS3 amazonS3,
com.amazonaws.services.s3.model.ObjectMetadata objectMetadata,
String sourceBucket,
String sourceKey,
String targetBucket,
String targetKey,
boolean deleteSource)
Copies a file using multipart upload.
|
static com.amazonaws.auth.AWSCredentialsProvider |
getAWSCredentialsProvider(String awsSecretKeyId,
String awsSecretAccessKey)
Gets the credentials providers for the given AWS key and secret.
|
static void |
processSlices(long slice,
long length,
S3Utils.SliceConsumer consumer)
Calls the consumer on all slices.
|
protected static List<com.amazonaws.services.s3.model.PartETag> |
responsesToETags(List<com.amazonaws.services.s3.model.CopyPartResult> responses) |
public static final long NON_MULTIPART_COPY_MAX_SIZE
public static final long PART_SIZE
public static void processSlices(long slice, long length, S3Utils.SliceConsumer consumer)
slice
- the slice sizelength
- the total lengthconsumer
- the slice consumerpublic static com.amazonaws.services.s3.model.ObjectMetadata copyFileMultipart(com.amazonaws.services.s3.AmazonS3 amazonS3, com.amazonaws.services.s3.model.ObjectMetadata objectMetadata, String sourceBucket, String sourceKey, String targetBucket, String targetKey, boolean deleteSource)
amazonS3
- the S3 clientobjectMetadata
- the metadata of the object being copiedsourceBucket
- the source bucketsourceKey
- the source keytargetBucket
- the target buckettargetKey
- the target keydeleteSource
- whether to delete the source object if the copy is successfulprotected static List<com.amazonaws.services.s3.model.PartETag> responsesToETags(List<com.amazonaws.services.s3.model.CopyPartResult> responses)
public static com.amazonaws.services.s3.model.ObjectMetadata copyFile(com.amazonaws.services.s3.AmazonS3 amazonS3, com.amazonaws.services.s3.model.ObjectMetadata objectMetadata, String sourceBucket, String sourceKey, String targetBucket, String targetKey, boolean deleteSource)
amazonS3
- the S3 clientobjectMetadata
- the metadata of the object being copiedsourceBucket
- the source bucketsourceKey
- the source keytargetBucket
- the target buckettargetKey
- the target keydeleteSource
- whether to delete the source object if the copy is successfulpublic static com.amazonaws.auth.AWSCredentialsProvider getAWSCredentialsProvider(String awsSecretKeyId, String awsSecretAccessKey)
awsSecretKeyId
- the AWS key idawsSecretAccessKey
- the secretCopyright © 2018 Nuxeo. All rights reserved.