mirror of https://github.com/apache/jclouds.git
GCS support for conditional copies
This commit is contained in:
parent
165e9afd9f
commit
2499cb0ac2
|
@ -308,6 +308,19 @@ public final class GoogleCloudStorageBlobStore extends BaseBlobStore {
|
|||
@Override
|
||||
public String copyBlob(String fromContainer, String fromName, String toContainer, String toName,
|
||||
CopyOptions options) {
|
||||
if (options.ifMatch() != null) {
|
||||
throw new UnsupportedOperationException("GCS does not support ifMatch");
|
||||
}
|
||||
if (options.ifNoneMatch() != null) {
|
||||
throw new UnsupportedOperationException("GCS does not support ifNoneMatch");
|
||||
}
|
||||
if (options.ifModifiedSince() != null) {
|
||||
throw new UnsupportedOperationException("GCS does not support ifModifiedSince");
|
||||
}
|
||||
if (options.ifUnmodifiedSince() != null) {
|
||||
throw new UnsupportedOperationException("GCS does not support ifUnmodifiedSince");
|
||||
}
|
||||
|
||||
if (options.contentMetadata() == null && options.userMetadata() == null) {
|
||||
return api.getObjectApi().copyObject(toContainer, Strings2.urlEncode(toName), fromContainer,
|
||||
Strings2.urlEncode(fromName)).etag();
|
||||
|
|
|
@ -268,4 +268,52 @@ public class GoogleCloudStorageBlobIntegrationLiveTest extends BaseBlobIntegrati
|
|||
throw new SkipException("request signing not supported on GCS", uoe);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@Test(expectedExceptions = UnsupportedOperationException.class)
|
||||
public void testCopyIfMatch() throws Exception {
|
||||
super.testCopyIfMatch();
|
||||
}
|
||||
|
||||
@Override
|
||||
@Test(expectedExceptions = UnsupportedOperationException.class)
|
||||
public void testCopyIfMatchNegative() throws Exception {
|
||||
super.testCopyIfMatch();
|
||||
}
|
||||
|
||||
@Override
|
||||
@Test(expectedExceptions = UnsupportedOperationException.class)
|
||||
public void testCopyIfNoneMatch() throws Exception {
|
||||
super.testCopyIfNoneMatch();
|
||||
}
|
||||
|
||||
@Override
|
||||
@Test(expectedExceptions = UnsupportedOperationException.class)
|
||||
public void testCopyIfNoneMatchNegative() throws Exception {
|
||||
super.testCopyIfNoneMatch();
|
||||
}
|
||||
|
||||
@Override
|
||||
@Test(expectedExceptions = UnsupportedOperationException.class)
|
||||
public void testCopyIfModifiedSince() throws Exception {
|
||||
super.testCopyIfModifiedSince();
|
||||
}
|
||||
|
||||
@Override
|
||||
@Test(expectedExceptions = UnsupportedOperationException.class)
|
||||
public void testCopyIfModifiedSinceNegative() throws Exception {
|
||||
super.testCopyIfModifiedSince();
|
||||
}
|
||||
|
||||
@Override
|
||||
@Test(expectedExceptions = UnsupportedOperationException.class)
|
||||
public void testCopyIfUnmodifiedSince() throws Exception {
|
||||
super.testCopyIfUnmodifiedSince();
|
||||
}
|
||||
|
||||
@Override
|
||||
@Test(expectedExceptions = UnsupportedOperationException.class)
|
||||
public void testCopyIfUnmodifiedSinceNegative() throws Exception {
|
||||
super.testCopyIfUnmodifiedSince();
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue