1
0
Fork 0
mirror of https://github.com/fog/fog.git synced 2022-11-09 13:51:43 -05:00
fog--fog/lib/fog/aws/requests/s3/copy_object.rb
2009-07-14 16:04:39 -07:00

20 lines
594 B
Ruby

module Fog
module AWS
class S3
# Copy an object from one S3 bucket to another
# FIXME: docs
def copy_object(source_bucket_name, source_object_name, destination_bucket_name, destination_object_name)
request({
:expects => 200,
:headers => { 'x-amz-copy-source' => "/#{source_bucket_name}/#{source_object_name}" },
:host => "#{destination_bucket_name}.#{@host}",
:method => 'PUT',
:parser => Fog::Parsers::AWS::S3::CopyObject.new,
:path => destination_object_name
})
end
end
end
end