2011-06-15 18:00:20 -04:00
|
|
|
module Fog
|
2011-10-17 15:25:07 -04:00
|
|
|
module Storage
|
|
|
|
class HP
|
2011-06-15 18:00:20 -04:00
|
|
|
class Real
|
|
|
|
|
|
|
|
# Get headers for object
|
|
|
|
#
|
|
|
|
# ==== Parameters
|
|
|
|
# * container<~String> - Name of container to look in
|
|
|
|
# * object<~String> - Name of object to look for
|
|
|
|
#
|
|
|
|
def head_object(container, object)
|
|
|
|
response = request({
|
2012-10-17 15:02:42 -04:00
|
|
|
:expects => 200, # should be 204
|
2011-06-15 18:00:20 -04:00
|
|
|
:method => 'HEAD',
|
2012-03-21 16:59:08 -04:00
|
|
|
:path => "#{Fog::HP.escape(container)}/#{Fog::HP.escape(object)}"
|
2011-06-15 18:00:20 -04:00
|
|
|
}, false)
|
|
|
|
response
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|
2011-07-29 11:33:28 -04:00
|
|
|
|
|
|
|
class Mock # :nodoc:all
|
|
|
|
|
|
|
|
def head_object(container_name, object_name, options = {})
|
|
|
|
response = get_object(container_name, object_name, options)
|
|
|
|
response.body = nil
|
2012-10-17 15:02:42 -04:00
|
|
|
response.status = 200 # should be 204
|
2011-07-29 11:33:28 -04:00
|
|
|
response
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|
|
|
|
|
2011-06-15 18:00:20 -04:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|