mirror of https://github.com/apache/jclouds.git
JCLOUDS-651: S3 support for conditional copies
This commit is contained in:
parent
467f3483bc
commit
6cdb1216a7
|
@ -270,6 +270,18 @@ public class S3BlobStore extends BaseBlobStore {
|
||||||
public String copyBlob(String fromContainer, String fromName, String toContainer, String toName,
|
public String copyBlob(String fromContainer, String fromName, String toContainer, String toName,
|
||||||
CopyOptions options) {
|
CopyOptions options) {
|
||||||
CopyObjectOptions s3Options = new CopyObjectOptions();
|
CopyObjectOptions s3Options = new CopyObjectOptions();
|
||||||
|
if (options.ifMatch() != null) {
|
||||||
|
s3Options.ifSourceETagMatches(options.ifMatch());
|
||||||
|
}
|
||||||
|
if (options.ifNoneMatch() != null) {
|
||||||
|
s3Options.ifSourceETagDoesntMatch(options.ifNoneMatch());
|
||||||
|
}
|
||||||
|
if (options.ifModifiedSince() != null) {
|
||||||
|
s3Options.ifSourceModifiedSince(options.ifModifiedSince());
|
||||||
|
}
|
||||||
|
if (options.ifUnmodifiedSince() != null) {
|
||||||
|
s3Options.ifSourceUnmodifiedSince(options.ifUnmodifiedSince());
|
||||||
|
}
|
||||||
|
|
||||||
ContentMetadata contentMetadata = options.contentMetadata();
|
ContentMetadata contentMetadata = options.contentMetadata();
|
||||||
if (contentMetadata != null) {
|
if (contentMetadata != null) {
|
||||||
|
|
|
@ -18,10 +18,16 @@ package org.jclouds.aws.s3.blobstore.integration;
|
||||||
|
|
||||||
import org.jclouds.s3.blobstore.integration.S3BlobIntegrationLiveTest;
|
import org.jclouds.s3.blobstore.integration.S3BlobIntegrationLiveTest;
|
||||||
import org.testng.annotations.Test;
|
import org.testng.annotations.Test;
|
||||||
|
import org.testng.SkipException;
|
||||||
|
|
||||||
@Test(groups = "live", testName = "AWSS3BlobIntegrationLiveTest")
|
@Test(groups = "live", testName = "AWSS3BlobIntegrationLiveTest")
|
||||||
public class AWSS3BlobIntegrationLiveTest extends S3BlobIntegrationLiveTest {
|
public class AWSS3BlobIntegrationLiveTest extends S3BlobIntegrationLiveTest {
|
||||||
public AWSS3BlobIntegrationLiveTest() {
|
public AWSS3BlobIntegrationLiveTest() {
|
||||||
provider = "aws-s3";
|
provider = "aws-s3";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void testCopyIfModifiedSinceNegative() throws Exception {
|
||||||
|
throw new SkipException("S3 supports copyIfModifiedSince but test uses time in the future which Amazon does not support");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue