You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@jclouds.apache.org by Zack Shoylev <no...@github.com> on 2015/04/01 00:33:55 UTC
[jclouds] Allows copying an object and modifying metadata (user and
object) (#718)
You can view, comment on, or merge this pull request online at:
https://github.com/jclouds/jclouds/pull/718
-- Commit Summary --
* Allows copying an object and modifying metadata (user and object)
-- File Changes --
M apis/openstack-swift/src/main/java/org/jclouds/openstack/swift/v1/binders/BindMetadataToHeaders.java (6)
M apis/openstack-swift/src/main/java/org/jclouds/openstack/swift/v1/features/ObjectApi.java (33)
M apis/openstack-swift/src/test/java/org/jclouds/openstack/swift/v1/features/ObjectApiMockTest.java (56)
-- Patch Links --
https://github.com/jclouds/jclouds/pull/718.patch
https://github.com/jclouds/jclouds/pull/718.diff
---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds/pull/718
Re: [jclouds] Allows copying an object and modifying metadata (user
and object) (#718)
Posted by Andrew Gaul <no...@github.com>.
> + * Unprefixed/unescaped metadata, such as Content-Disposition
> + *
> + * @return {@code true} if the object was successfully copied, {@code false} if not.
> + *
> + * @throws org.jclouds.openstack.swift.v1.CopyObjectException if the source or destination container do not exist.
> + */
> + @Named("object:copy")
> + @PUT
> + @Path("/{destinationObject}")
> + @Headers(keys = OBJECT_COPY_FROM, values = "/{sourceContainer}/{sourceObject}")
> + @Fallback(FalseOnContainerNotFound.class)
> + boolean copy(@PathParam("destinationObject") String destinationObject,
> + @PathParam("sourceContainer") String sourceContainer,
> + @PathParam("sourceObject") String sourceObject,
> + @BinderParam(BindObjectMetadataToHeaders.class) Map<String, String> userMetadata,
> + @BinderParam(BindHeaderMetadataToHeaders.class) Map<String, String> objectMetadata);
Should we reverse these parameters? Also does this allow an easy way to copy the metadata from an existing object? I would like to make the simple case of copying all objects from one container to another as easy as possible.
---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds/pull/718/files#r27531014
Re: [jclouds] Allows copying an object and modifying metadata (user
and object) (#718)
Posted by Andrew Gaul <no...@github.com>.
Pushed to master as a1cbec10925a05bf0a05c6ddb3f9eb51c7f155ea and 576005a33553d3b682bdd7088c10c5e7da1c004e.
---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds/pull/718#issuecomment-90270179
Re: [jclouds] Allows copying an object and modifying metadata (user
and object) (#718)
Posted by Zack Shoylev <no...@github.com>.
I have added a live test that demonstrates how the copy would work with real conditions.
Unfortunately, the content- metadata is handled separately and is also filtered from the headers. Which makes all of this very clunky! However, I did not want to address the header-filtering in this PR (or maybe at all).
---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds/pull/718#issuecomment-89042701
Re: [jclouds] Allows copying an object and modifying metadata (user
and object) (#718)
Posted by Zack Shoylev <no...@github.com>.
https://issues.apache.org/jira/browse/JCLOUDS-872
---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds/pull/718#issuecomment-88272534
Re: [jclouds] Allows copying an object and modifying metadata (user
and object) (#718)
Posted by Zack Shoylev <no...@github.com>.
> + * Unprefixed/unescaped metadata, such as Content-Disposition
> + *
> + * @return {@code true} if the object was successfully copied, {@code false} if not.
> + *
> + * @throws org.jclouds.openstack.swift.v1.CopyObjectException if the source or destination container do not exist.
> + */
> + @Named("object:copy")
> + @PUT
> + @Path("/{destinationObject}")
> + @Headers(keys = OBJECT_COPY_FROM, values = "/{sourceContainer}/{sourceObject}")
> + @Fallback(FalseOnContainerNotFound.class)
> + boolean copy(@PathParam("destinationObject") String destinationObject,
> + @PathParam("sourceContainer") String sourceContainer,
> + @PathParam("sourceObject") String sourceObject,
> + @BinderParam(BindObjectMetadataToHeaders.class) Map<String, String> userMetadata,
> + @BinderParam(BindHeaderMetadataToHeaders.class) Map<String, String> objectMetadata);
A very good point. I will investigate.
---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds/pull/718/files#r27531355