Method: Fog::Storage::Local::Files#head

Defined in:
lib/fog/local/models/storage/files.rb

#head(key) ⇒ Object



57
58
59
60
61
62
63
64
65
66
67
68
69
# File 'lib/fog/local/models/storage/files.rb', line 57

def head(key)
  requires :directory
  path = file_path(key)
  if ::File.exist?(path)
    new({
      :content_length => ::File.size(path),
      :key            => key,
      :last_modified  => ::File.mtime(path)
    })
  else
    nil
  end
end