Provides options for copying an Amazon S3 object from a source location to a new destination.
All CopyObjectRequests must specify a source bucket and key, along with a destination bucket and key. Beyond that, requests also specify:
CopyObjectRequests
733734735736737738739740741742743
ClassLoader contextClassLoader = Thread.currentThread().getContextClassLoader(); try { Thread.currentThread().setContextClassLoader( getClass().getClassLoader()); String newS3Key = convertKey(oldKey); CopyObjectRequest copReq = new CopyObjectRequest(bucket, oldKey, bucket, newS3Key); s3service.copyObject(copReq); LOG.debug("[{}] renamed to [{}] ", oldKey, newS3Key); } finally { if (contextClassLoader != null) {
171172173174175176177178179180181182183
if (l != file.length()) { throw new DataStoreException("Collision: " + key + " new length: " + file.length() + " old length: " + l); } LOG.debug(key + " exists"); CopyObjectRequest copReq = new CopyObjectRequest(bucket, key, bucket, key); copReq.setNewObjectMetadata(objectMetaData); s3service.copyObject(copReq); LOG.debug("lastModified of " + identifier.toString() + " updated successfully"); LOG.debug(" updated"); }
235236237238239240241242243244245246247
try { if (minModifiedDate != 0) { ObjectMetadata objectMetaData = s3service.getObjectMetadata( bucket, key); if (objectMetaData.getLastModified().getTime() < minModifiedDate) { CopyObjectRequest copReq = new CopyObjectRequest(bucket, key, bucket, key); copReq.setNewObjectMetadata(objectMetaData); s3service.copyObject(copReq); LOG.debug("lastModified of " + identifier.toString() + " updated successfully"); } }
823824825826827828829830
assertParameterNotNull(key, "The key parameter must be specified when changing an object's storage class"); assertParameterNotNull(newStorageClass, "The newStorageClass parameter must be specified when changing an object's storage class"); copyObject(new CopyObjectRequest(bucketName, key, bucketName, key) .withStorageClass(newStorageClass.toString())); }
839840841842843844845846
assertParameterNotNull(key, "The key parameter must be specified when changing an object's storage class"); assertParameterNotNull(newRedirectLocation, "The newStorageClass parameter must be specified when changing an object's storage class"); copyObject(new CopyObjectRequest(bucketName, key, bucketName, key) .withRedirectLocation(newRedirectLocation)); }
11931194119511961197119811991200
* @see com.amazonaws.services.s3.AmazonS3#copyObject(java.lang.String, java.lang.String, java.lang.String, java.lang.String) */ public CopyObjectResult copyObject(String sourceBucketName, String sourceKey, String destinationBucketName, String destinationKey) throws AmazonClientException, AmazonServiceException { return copyObject(new CopyObjectRequest(sourceBucketName, sourceKey, destinationBucketName, destinationKey)); }
671672673674675676677678
979980981982983984985986
169170171172173174175176177178179180181
233234235236237238239240241242243244245