Class | AWS::S3::ObjectMetadata |
In: |
lib/aws/s3/object_metadata.rb
|
Parent: | Object |
Returns an object that represents the metadata for an S3 object.
object | [R] | @return [S3Object] |
@param [S3Object] object @param [Hash] options @option options [String] :version_id A specific version of the object
to get metadata for
Returns the value for the given name stored in the S3Object‘s metadata:
bucket.objects['myobject'].metadata['purpose'] # returns nil if the given metadata key has not been set
@param [String,Symbol] name The name of the metadata field to
get.
@return [String,nil] Returns the metadata for the given name.
Changes the value of the given name stored in the S3Object‘s metadata:
object = bucket.object['myobject'] object.metadata['purpose'] = 'research' object.metadata['purpose'] # => 'research'
@deprecated In order to safely update an S3 object‘s metadata, you
should use {S3Object#copy_from}. This operation does not preserve the ACL, storage class (standard vs. reduced redundancy) or server side encryption settings. Using this method on anything other than vanilla S3 objects risks clobbering other metadata values set on the object.
@note The name and value of each metadata field must conform
to US-ASCII.
@param [String,Symbol] name The name of the metadata field to
set.
@param [String] value The new value of the metadata field.
@return [String,nil] Returns the value that was set.