JCLOUDS-883: Replace metadata during Swift copy

Previously Swift copy would append metadata instead of replacing it.
This commit is contained in:
Andrew Gaul 2015-08-06 11:23:21 -07:00
parent 53c3a4918a
commit 4f32e863ad
3 changed files with 3 additions and 6 deletions

View File

@ -19,6 +19,7 @@ package org.jclouds.openstack.swift.v1.features;
import static com.google.common.net.HttpHeaders.EXPECT;
import static javax.ws.rs.core.MediaType.APPLICATION_JSON;
import static org.jclouds.openstack.swift.v1.reference.SwiftHeaders.OBJECT_COPY_FROM;
import static org.jclouds.openstack.swift.v1.reference.SwiftHeaders.OBJECT_COPY_FRESH_METADATA;
import java.util.Map;
@ -309,7 +310,7 @@ public interface ObjectApi {
@Named("object:copy")
@PUT
@Path("/{destinationObject}")
@Headers(keys = OBJECT_COPY_FROM, values = "/{sourceContainer}/{sourceObject}")
@Headers(keys = {OBJECT_COPY_FROM, OBJECT_COPY_FRESH_METADATA}, values = {"/{sourceContainer}/{sourceObject}", "True"})
@Fallback(FalseOnKeyNotFound.class)
boolean copy(@PathParam("destinationObject") String destinationObject,
@PathParam("sourceContainer") String sourceContainer,

View File

@ -71,6 +71,7 @@ public final class SwiftHeaders {
public static final String CONTAINER_WEB_MODE = "X-Web-Mode";
public static final String OBJECT_COPY_FROM = "X-Copy-From";
public static final String OBJECT_COPY_FRESH_METADATA = "X-Fresh-Metadata";
public static final String OBJECT_DELETE_AFTER = "X-Delete-After";
public static final String OBJECT_DELETE_AT = "X-Delete-At";
public static final String OBJECT_MANIFEST = "X-Object-Manifest";

View File

@ -79,11 +79,6 @@ public class SwiftBlobIntegrationLiveTest extends BaseBlobIntegrationTest {
throw new SkipException("unsupported in swift");
}
@Override
public void testCopyBlobReplaceMetadata() throws Exception {
throw new SkipException("Swift only supports appending to user metadata, not replacing it");
}
@Override
protected long getMinimumMultipartBlobSize() {
return 1;