diff --git a/lib/fog/ninefold/models/storage/files.rb b/lib/fog/ninefold/models/storage/files.rb index c1fcd7675..99d8ea8a3 100644 --- a/lib/fog/ninefold/models/storage/files.rb +++ b/lib/fog/ninefold/models/storage/files.rb @@ -51,12 +51,13 @@ module Fog def head(key, options = {}) requires :directory - data = connection.head_object(directory.key, key) + data = connection.head_namespace(directory.key + key, :parse => false) file_data = data.headers.merge({ + :body => data.body, :key => key }) new(file_data) - rescue Fog::Storage::Rackspace::NotFound + rescue Fog::Storage::Ninefold::NotFound nil end diff --git a/lib/fog/ninefold/requests/storage/head_namespace.rb b/lib/fog/ninefold/requests/storage/head_namespace.rb new file mode 100644 index 000000000..436d65717 --- /dev/null +++ b/lib/fog/ninefold/requests/storage/head_namespace.rb @@ -0,0 +1,20 @@ +module Fog + module Storage + class Ninefold + class Real + + def head_namespace(namespace = '', options = {}) + options = options.reject {|key, value| value.nil?} + request({ + :expects => 200, + :method => 'HEAD', + :path => "namespace/" + namespace, + :query => {}, + :parse => true + }.merge(options)) + end + + end + end + end +end diff --git a/lib/fog/ninefold/storage.rb b/lib/fog/ninefold/storage.rb index b561d0301..a9f80e0e4 100644 --- a/lib/fog/ninefold/storage.rb +++ b/lib/fog/ninefold/storage.rb @@ -20,6 +20,7 @@ module Fog request_path 'fog/ninefold/requests/storage' # request :delete_container request :get_namespace + request :head_namespace request :post_namespace request :put_namespace request :delete_namespace