/** * <p> * Sets the optional Amazon S3 storage class to use when storing the newly * copied object and returns this <code>CopyObjectRequest</code>, enabling additional * method calls to be chained together. If not specified, the default * standard storage class is used. * </p> * <p> * For more information on Amazon S3 storage classes and available values, * see the {@link StorageClass} enumeration. * </p> * * @return This <code>CopyObjectRequest</code>, enabling additional method calls to be * chained together. */ public CopyObjectRequest withStorageClass(String storageClass) { setStorageClass(storageClass); return this; }
/** * <p> * Sets the optional Amazon S3 storage class to use when storing the newly * copied object and returns this CopyObjectRequest, enabling additional * method calls to be chained together. If not specified, the default standard storage class * is used. * </p> * <p> * For more information on Amazon S3 storage classes and available values, * see the {@link StorageClass} enumeration. * </p> * * @return This <code>CopyObjectRequest</code>, enabling additional method calls to be * chained together. */ public CopyObjectRequest withStorageClass(StorageClass storageClass) { setStorageClass(storageClass); return this; }
/** * <p> * Sets the optional Amazon S3 storage class to use when storing the newly * copied object and returns this <code>CopyObjectRequest</code>, enabling * additional method calls to be chained together. If not specified, the * default standard storage class is used. * </p> * <p> * For more information on Amazon S3 storage classes and available values, * see the {@link StorageClass} enumeration. * </p> * * @return This <code>CopyObjectRequest</code>, enabling additional method * calls to be chained together. */ public CopyObjectRequest withStorageClass(String storageClass) { setStorageClass(storageClass); return this; }
/** * <p> * Sets the optional Amazon S3 storage class to use when storing the newly * copied object and returns this CopyObjectRequest, enabling additional * method calls to be chained together. If not specified, the default * standard storage class is used. * </p> * <p> * For more information on Amazon S3 storage classes and available values, * see the {@link StorageClass} enumeration. * </p> * * @return This <code>CopyObjectRequest</code>, enabling additional method * calls to be chained together. */ public CopyObjectRequest withStorageClass(StorageClass storageClass) { setStorageClass(storageClass); return this; }
/** * <p> * Sets the optional Amazon S3 storage class to use when storing the newly * copied object and returns this <code>CopyObjectRequest</code>, enabling additional * method calls to be chained together. If not specified, the default * standard storage class is used. * </p> * <p> * For more information on Amazon S3 storage classes and available values, * see the {@link StorageClass} enumeration. * </p> * * @return This <code>CopyObjectRequest</code>, enabling additional method calls to be * chained together. */ public CopyObjectRequest withStorageClass(String storageClass) { setStorageClass(storageClass); return this; }
/** * <p> * Sets the optional Amazon S3 storage class to use when storing the newly * copied object and returns this CopyObjectRequest, enabling additional * method calls to be chained together. If not specified, the default standard storage class * is used. * </p> * <p> * For more information on Amazon S3 storage classes and available values, * see the {@link StorageClass} enumeration. * </p> * * @return This <code>CopyObjectRequest</code>, enabling additional method calls to be * chained together. */ public CopyObjectRequest withStorageClass(StorageClass storageClass) { setStorageClass(storageClass); return this; }
/** * <p> * Sets the optional Amazon S3 storage class to use when storing the newly * copied object and returns this <code>CopyObjectRequest</code>, enabling * additional method calls to be chained together. If not specified, the * default standard storage class is used. * </p> * <p> * For more information on Amazon S3 storage classes and available values, * see the {@link StorageClass} enumeration. * </p> * * @return This <code>CopyObjectRequest</code>, enabling additional method * calls to be chained together. */ public CopyObjectRequest withStorageClass(String storageClass) { setStorageClass(storageClass); return this; }
/** * <p> * Sets the optional Amazon S3 storage class to use when storing the newly * copied object and returns this CopyObjectRequest, enabling additional * method calls to be chained together. If not specified, the default * standard storage class is used. * </p> * <p> * For more information on Amazon S3 storage classes and available values, * see the {@link StorageClass} enumeration. * </p> * * @return This <code>CopyObjectRequest</code>, enabling additional method * calls to be chained together. */ public CopyObjectRequest withStorageClass(StorageClass storageClass) { setStorageClass(storageClass); return this; }
this.targetS3BucketName, tocInfo.path); copyRequest.setStorageClass(storageClass);
final CopyObjectRequest request = new CopyObjectRequest(options.getSourceBucket(), key, options.getDestinationBucket(), keydest); request.setStorageClass(StorageClass.valueOf(options.getStorageClass()));
@Override public String copyContent(String sourceSpaceId, String sourceContentId, String destSpaceId, String destContentId) { log.debug("copyContent({}, {}, {}, {})", sourceSpaceId, sourceContentId, destSpaceId, destContentId); // Will throw if source bucket does not exist String sourceBucketName = getBucketName(sourceSpaceId); // Will throw if destination bucket does not exist String destBucketName = getBucketName(destSpaceId); throwIfContentNotExist(sourceBucketName, sourceContentId); CopyObjectRequest request = new CopyObjectRequest(sourceBucketName, sourceContentId, destBucketName, destContentId); request.setStorageClass(DEFAULT_STORAGE_CLASS); request.setCannedAccessControlList(CannedAccessControlList.Private); CopyObjectResult result = doCopyObject(request); return StorageProviderUtil.compareChecksum(this, sourceSpaceId, sourceContentId, result.getETag()); }
@VisibleForTesting CopyObjectResult atomicCopy( S3ResourceId sourcePath, S3ResourceId destinationPath, ObjectMetadata sourceObjectMetadata) throws AmazonClientException { CopyObjectRequest copyObjectRequest = new CopyObjectRequest( sourcePath.getBucket(), sourcePath.getKey(), destinationPath.getBucket(), destinationPath.getKey()); copyObjectRequest.setNewObjectMetadata(sourceObjectMetadata); copyObjectRequest.setStorageClass(options.getS3StorageClass()); copyObjectRequest.setSourceSSECustomerKey(options.getSSECustomerKey()); copyObjectRequest.setDestinationSSECustomerKey(options.getSSECustomerKey()); return amazonS3.copyObject(copyObjectRequest); }
private void updateObjectProperties(String bucketName, String contentId, ObjectMetadata objMetadata) { try { AccessControlList originalACL = s3Client.getObjectAcl(bucketName, contentId); CopyObjectRequest copyRequest = new CopyObjectRequest(bucketName, contentId, bucketName, contentId); copyRequest.setStorageClass(DEFAULT_STORAGE_CLASS); copyRequest.setNewObjectMetadata(objMetadata); s3Client.copyObject(copyRequest); s3Client.setObjectAcl(bucketName, contentId, originalACL); } catch (AmazonClientException e) { throwIfContentNotExist(bucketName, contentId); String err = "Could not update metadata for content " + contentId + " in S3 bucket " + bucketName + " due to error: " + e.getMessage(); throw new StorageException(err, e, NO_RETRY); } }