mirror of https://github.com/apache/jclouds.git
Bind Swift content metadata in multipart upload
This commit is contained in:
parent
317089c77e
commit
e8f925225c
|
@ -369,11 +369,23 @@ public interface CommonSwiftClient extends Closeable {
|
|||
* {@link org.jclouds.openstack.swift.v1.features.ObjectApi#replaceManifest()}
|
||||
*/
|
||||
@Deprecated
|
||||
|
||||
@Named("PutObjectManifest")
|
||||
@PUT
|
||||
@Path("/{container}/{name}")
|
||||
@ResponseParser(ParseETagHeader.class)
|
||||
@Headers(keys = "X-Object-Manifest", values = "{container}/{name}/")
|
||||
String putObjectManifest(@PathParam("container") String container, @PathParam("name") String name);
|
||||
|
||||
/**
|
||||
* @deprecated This method will be replaced by
|
||||
* {@link org.jclouds.openstack.swift.v1.features.ObjectApi#replaceManifest()}
|
||||
*/
|
||||
@Deprecated
|
||||
@Named("PutObjectManifest")
|
||||
@PUT
|
||||
@Path("/{container}/{name}")
|
||||
@ResponseParser(ParseETagHeader.class)
|
||||
@Headers(keys = "X-Object-Manifest", values = "{container}/{name}/")
|
||||
String putObjectManifest(@PathParam("container") String container, @PathParam("name") @ParamParser(ObjectName.class)
|
||||
@BinderParam(BindSwiftObjectMetadataToRequest.class) SwiftObject object);
|
||||
}
|
||||
|
|
|
@ -30,6 +30,7 @@ import org.jclouds.io.PayloadSlicer;
|
|||
import org.jclouds.logging.Logger;
|
||||
import org.jclouds.openstack.swift.CommonSwiftClient;
|
||||
import org.jclouds.openstack.swift.blobstore.functions.BlobToObject;
|
||||
import org.jclouds.openstack.swift.domain.SwiftObject;
|
||||
|
||||
import com.google.inject.Inject;
|
||||
|
||||
|
@ -78,7 +79,11 @@ public class SequentialMultipartUploadStrategy implements MultipartUploadStrateg
|
|||
.build();
|
||||
client.putObject(container, blob2Object.apply(blobPart));
|
||||
}
|
||||
return client.putObjectManifest(container, key);
|
||||
|
||||
SwiftObject manifest = blob2Object.apply(blob);
|
||||
// put empty manifest object retaining existing metadata
|
||||
manifest.getPayload().getContentMetadata().setContentLength(0L);
|
||||
return client.putObjectManifest(container, manifest);
|
||||
} else {
|
||||
return client.putObject(container, blob2Object.apply(blob));
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue