JCLOUDS-651: Atmos support for conditional copies

This commit is contained in:
Andrew Gaul 2016-02-12 20:43:27 -08:00
parent 66609e6d70
commit cc8af838e8
2 changed files with 37 additions and 0 deletions

View File

@ -45,6 +45,7 @@ import org.jclouds.blobstore.domain.PageSet;
import org.jclouds.blobstore.domain.StorageMetadata;
import org.jclouds.blobstore.functions.BlobToHttpGetOptions;
import org.jclouds.blobstore.internal.BaseBlobStore;
import org.jclouds.blobstore.options.CopyOptions;
import org.jclouds.blobstore.options.CreateContainerOptions;
import org.jclouds.blobstore.options.PutOptions;
import org.jclouds.blobstore.strategy.internal.FetchBlobMetadata;
@ -334,4 +335,16 @@ public class AtmosBlobStore extends BaseBlobStore {
public int getMaximumNumberOfParts() {
throw new UnsupportedOperationException("Atmos does not support multipart uploads");
}
@Override
public String copyBlob(String fromContainer, String fromName, String toContainer, String toName,
CopyOptions options) {
if (options.ifMatch() != null) {
throw new UnsupportedOperationException("Atmos does not support ifMatch");
}
if (options.ifNoneMatch() != null) {
throw new UnsupportedOperationException("Atmos does not support ifNoneMatch");
}
return super.copyBlob(fromContainer, fromName, toContainer, toName, options);
}
}

View File

@ -164,4 +164,28 @@ public class AtmosIntegrationLiveTest extends BaseBlobIntegrationTest {
public void testPutBlobAccessMultipart() throws Exception {
super.testPutBlobAccessMultipart();
}
@Override
@Test(groups = { "integration", "live" }, expectedExceptions = UnsupportedOperationException.class)
public void testCopyIfMatch() throws Exception {
super.testCopyIfMatch();
}
@Override
@Test(groups = { "integration", "live" }, expectedExceptions = UnsupportedOperationException.class)
public void testCopyIfMatchNegative() throws Exception {
super.testCopyIfMatchNegative();
}
@Override
@Test(groups = { "integration", "live" }, expectedExceptions = UnsupportedOperationException.class)
public void testCopyIfNoneMatch() throws Exception {
super.testCopyIfNoneMatch();
}
@Override
@Test(groups = { "integration", "live" }, expectedExceptions = UnsupportedOperationException.class)
public void testCopyIfNoneMatchNegative() throws Exception {
super.testCopyIfNoneMatchNegative();
}
}