def object_metadata
@object_metadata ||= (
begin
response = SwiftClient.head_object(self.container.connection.storageurl, self.container.connection.authtoken, self.container.escaped_name, escaped_name)
rescue ClientException => e
raise CloudFiles::Exception::NoSuchObject, "Object #{@name} does not exist" unless (e.status.to_s =~ /^20/)
end
resphash = {}
metas = response.to_hash.select { |k,v| k.match(/^x-object-meta/) }
metas.each do |x,y|
resphash[x] = (y.respond_to?(:join) ? y.join('') : y.to_s)
end
{
:manifest => response["x-object-manifest"],
:bytes => response["content-length"],
:last_modified => Time.parse(response["last-modified"]),
:etag => response["etag"],
:content_type => response["content-type"],
:metadata => resphash
}
)
end