Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enhanced copy-object #1

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Conversation

drewr
Copy link

@drewr drewr commented Feb 20, 2012

I needed the ability to perform a copy-in-place for the purposes of updating metadata on an object. This is S3's sanctioned (and only) way to update, for example, x-amz-meta headers.

I don't love the impl mainly because the args to copy-object are getting a bit unwieldy, but functionally it does what I want. Would appreciate you considering it or something like it in the codebase.

Determines whether copy-object will clobber the old meta or append.
@weavejester
Copy link
Owner

Apologies for taking a few days to reply to this.

My plan regarding copy-object was to switch to a map of objects after four arguments, so something like:

(copy-object
  {:src  {:bucket "foo" :key "bar"}
   :dest {:bucket "foo" :key "baz"}
   :metadata {...}})

With maybe a few shortcuts for common cases where the source and destination buckets are the same:

(copy-object
  {:bucket "foo" :src "bar" :dest "baz"})

I'm also avoiding any functions that deal with Java AWS objects directly, like your set-object-meta function. I want to ensure that all public functions just take Clojure data-structures.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants