Package org.nuxeo.ecm.core.storage.sql
Class S3Utils
java.lang.Object
org.nuxeo.ecm.core.storage.sql.S3Utils
AWS S3 utilities.
- Since:
- 10.1
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic interface
Represents an operation that accepts a slice number and a slice begin and end position. -
Field Summary
Modifier and TypeFieldDescriptionstatic final long
Deprecated.static final String
Deprecated.since 2021.11, useS3BlobStoreConfiguration.MULTIPART_COPY_PART_SIZE_PROPERTY
instead.static final long
The maximum size of a file that can be copied without using multipart: 5 GBstatic final long
Deprecated.since 11.1, useMULTIPART_COPY_PART_SIZE_DEFAULT
instead -
Method Summary
Modifier and TypeMethodDescriptionstatic 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) 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, String targetSSEAlgorithm, boolean deleteSource) Deprecated.since 11.2, useTransferManager.copy(java.lang.String, java.lang.String, java.lang.String, java.lang.String)
insteadstatic 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) Deprecated.since 11.1, usecopyFileMultipart(AmazonS3, ObjectMetadata, String, String, String, String, String, boolean)
insteadstatic 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, String targetSSEAlgorithm, boolean deleteSource) Deprecated.since 11.2, useTransferManager.copy(java.lang.String, java.lang.String, java.lang.String, java.lang.String)
insteadstatic com.amazonaws.services.s3.model.ObjectMetadata
copyFileNonMultipart
(com.amazonaws.services.s3.AmazonS3 amazonS3, com.amazonaws.services.s3.model.ObjectMetadata objectMetadata, String sourceBucket, String sourceKey, String targetBucket, String targetKey, String targetSSEAlgorithm, boolean deleteSource) Deprecated.since 11.2, useTransferManager.copy(java.lang.String, java.lang.String, java.lang.String, java.lang.String)
insteadstatic com.amazonaws.auth.AWSCredentialsProvider
getAWSCredentialsProvider
(String accessKeyId, String secretKey, String sessionToken) 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)
-
Field Details
-
NON_MULTIPART_COPY_MAX_SIZE
public static final long NON_MULTIPART_COPY_MAX_SIZEThe maximum size of a file that can be copied without using multipart: 5 GB- See Also:
-
MULTIPART_COPY_PART_SIZE_DEFAULT
Deprecated.since 2021.11, useS3BlobStoreConfiguration.MULTIPART_COPY_PART_SIZE_DEFAULT
instead.The default multipart copy part size. This default is used only if the configuration service is not available or if the configuration property "nuxeo.s3.multipart.copy.part.size" is not defined.- Since:
- 11.1
- See Also:
-
PART_SIZE
Deprecated.since 11.1, useMULTIPART_COPY_PART_SIZE_DEFAULT
instead- See Also:
-
MULTIPART_COPY_PART_SIZE_PROPERTY
Deprecated.since 2021.11, useS3BlobStoreConfiguration.MULTIPART_COPY_PART_SIZE_PROPERTY
instead.The configuration property to define the multipart copy part size.- Since:
- 11.1
- See Also:
-
-
Method Details
-
processSlices
Calls the consumer on all slices.- Parameters:
slice
- the slice sizelength
- the total lengthconsumer
- the slice consumer
-
copyFile
@Deprecated 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, String targetSSEAlgorithm, boolean deleteSource) Deprecated.since 11.2, useTransferManager.copy(java.lang.String, java.lang.String, java.lang.String, java.lang.String)
insteadCopies a file, using multipart upload if needed.- Parameters:
amazonS3
- the S3 clientobjectMetadata
- the metadata of the object being copiedsourceBucket
- the source bucketsourceKey
- the source keytargetBucket
- the target buckettargetKey
- the target keytargetSSEAlgorithm
- the target SSE Algorithm to use, ornull
deleteSource
- whether to delete the source object if the copy is successful- Since:
- 11.1
-
copyFileMultipart
@Deprecated public 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) Deprecated.since 11.1, usecopyFileMultipart(AmazonS3, ObjectMetadata, String, String, String, String, String, boolean)
insteadCopies a file using multipart upload.- Parameters:
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 successful
-
copyFileMultipart
@Deprecated public 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, String targetSSEAlgorithm, boolean deleteSource) Deprecated.since 11.2, useTransferManager.copy(java.lang.String, java.lang.String, java.lang.String, java.lang.String)
insteadCopies a file using multipart upload.- Parameters:
amazonS3
- the S3 clientobjectMetadata
- the metadata of the object being copiedsourceBucket
- the source bucketsourceKey
- the source keytargetBucket
- the target buckettargetKey
- the target keytargetSSEAlgorithm
- the target SSE Algorithm to use, ornull
deleteSource
- whether to delete the source object if the copy is successful- Since:
- 11.1
-
responsesToETags
-
copyFile
@Deprecated 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) Deprecated.Copies a file without using multipart upload.- Parameters:
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 successful
-
copyFileNonMultipart
@Deprecated public static com.amazonaws.services.s3.model.ObjectMetadata copyFileNonMultipart(com.amazonaws.services.s3.AmazonS3 amazonS3, com.amazonaws.services.s3.model.ObjectMetadata objectMetadata, String sourceBucket, String sourceKey, String targetBucket, String targetKey, String targetSSEAlgorithm, boolean deleteSource) Deprecated.since 11.2, useTransferManager.copy(java.lang.String, java.lang.String, java.lang.String, java.lang.String)
insteadCopies a file without using multipart upload.- Parameters:
amazonS3
- the S3 clientobjectMetadata
- the metadata of the object being copiedsourceBucket
- the source bucketsourceKey
- the source keytargetBucket
- the target buckettargetKey
- the target keytargetSSEAlgorithm
- the target SSE Algorithm to use, ornull
deleteSource
- whether to delete the source object if the copy is successful- Since:
- 11.1
-
getAWSCredentialsProvider
public static com.amazonaws.auth.AWSCredentialsProvider getAWSCredentialsProvider(String accessKeyId, String secretKey, String sessionToken) Gets the credentials providers for the given AWS key and secret.- Parameters:
accessKeyId
- the AWS access key idsecretKey
- the secret keysessionToken
- the session token (optional)- Since:
- 10.10
-
S3BlobStoreConfiguration.MULTIPART_COPY_PART_SIZE_DEFAULT
instead.