<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -75,9 +75,6 @@ module AWS
     #   song.content_type = 'application/pdf'
     #   song.store
     # 
-    # (Keep in mind that due to limitiations in S3's exposed API, the only way to change things like the content_type
-    # is to PUT the object onto S3 again. In the case of large files, this will result in fully re-uploading the file.)
-    # 
     # A bevie of information about an object can be had using the &lt;tt&gt;about&lt;/tt&gt; method:
     # 
     #   pp song.about
@@ -184,11 +181,22 @@ module AWS
           source_key      = path!(bucket, key)
           default_options = {'x-amz-copy-source' =&gt; source_key}
           target_key      = path!(bucket, copy_key)
-          returning put(target_key, default_options) do
+          returning put(target_key, default_options.merge(options)) do
             acl(copy_key, bucket, acl(key, bucket)) if options[:copy_acl]
           end
         end
-        
+
+        # Updates the object with &lt;tt&gt;key&lt;/tt&gt; by copying it in-place, preserving the ACL of the existing object.
+        # Useful for updating an object's metadata without having to re-PUT the data.
+        def update(key, bucket = nil, options = {})
+          bucket     = bucket_name(bucket)
+          source_key = path!(bucket, key)
+          default_options = {'x-amz-copy-source' =&gt; source_key, 'x-amz-metadata-directive' =&gt; 'REPLACE'}
+          returning put(source_key, default_options.merge(options)) do
+            acl(key, bucket, acl(key, bucket))
+          end
+        end
+
         # Rename the object with key &lt;tt&gt;from&lt;/tt&gt; to have key in &lt;tt&gt;to&lt;/tt&gt;.
         def rename(from, to, bucket = nil, options = {})
           copy(from, to, bucket, options)
@@ -538,7 +546,12 @@ module AWS
       end
       alias_method :create, :store
       alias_method :save,   :store
-      
+
+      # Updates the the current object by copying it in place.
+      def update
+        self.class.update(key, bucket.name, about.to_headers)
+      end
+
       # Deletes the current object. Trying to save an object after it has been deleted with
       # raise a DeletedObject exception.
       def delete
@@ -547,8 +560,7 @@ module AWS
         self.class.delete(key, bucket.name)
       end
       
-      # Copies the current object, given it the name &lt;tt&gt;copy_name&lt;/tt&gt;. Keep in mind that due to limitations in 
-      # S3's API, this operation requires retransmitting the entire object to S3.
+      # Copies the current object, giving it the name &lt;tt&gt;copy_name&lt;/tt&gt;.
       def copy(copy_name, options = {})
         self.class.copy(key, copy_name, bucket.name, options)
       end</diff>
      <filename>lib/aws/s3/object.rb</filename>
    </modified>
    <modified>
      <diff>@@ -157,7 +157,7 @@ class RemoteS3ObjectTest &lt; Test::Unit::TestCase
     
     response = fetch_object_at(object.url)
     assert (200..299).include?(response.code.to_i)
-    
+
     # Copy the object
     
     assert_nothing_raised do
@@ -363,6 +363,23 @@ class RemoteS3ObjectTest &lt; Test::Unit::TestCase
     end
   end
   
+  def test_updating_an_object_should_replace_its_metadata
+    key = 'updated-object'
+
+    S3Object.store(key, 'value does not matter', TEST_BUCKET)
+    object = S3Object.find(key, TEST_BUCKET)
+
+    object.content_type = 'foo/bar'
+    object.metadata[:foo] = 'bar'
+    object.update
+
+    reloaded_object = S3Object.find(key, TEST_BUCKET)
+    assert_equal 'foo/bar', reloaded_object.content_type
+    assert_equal 'bar', reloaded_object.metadata[:foo]
+  ensure
+    S3Object.delete(key, TEST_BUCKET)
+  end
+
   private
     def fetch_object_at(url)
       Net::HTTP.get_response(URI.parse(url))</diff>
      <filename>test/remote/object_test.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>a27181abe168af37bcd157304d0df1cbdf60bdae</id>
    </parent>
  </parents>
  <author>
    <name>Jeffrey Hardy</name>
    <email>packagethief@gmail.com</email>
  </author>
  <url>http://github.com/packagethief/aws-s3/commit/ba17303d2e84e7e493c663592947ef74321b93da</url>
  <id>ba17303d2e84e7e493c663592947ef74321b93da</id>
  <committed-date>2009-10-16T14:21:15-07:00</committed-date>
  <authored-date>2009-10-16T11:50:03-07:00</authored-date>
  <message>Add S3Object.update for updating things like the content-type without re-uploading the file</message>
  <tree>f51182ee84bf2fe3e6b731962be1e0fc74f699a3</tree>
  <committer>
    <name>Jeffrey Hardy</name>
    <email>packagethief@gmail.com</email>
  </committer>
</commit>
