Method: DropboxClient#metadata
- Defined in:
- lib/dropbox_sdk.rb
#metadata(path, file_limit = 25000, list = true, hash = nil, rev = nil, include_deleted = false) ⇒ Object
Retrives metadata for a file or folder
Arguments:
-
path: The path to the file or folder.
-
list: Whether to list all contained files (only applies when path refers to a folder).
-
file_limit: The maximum number of file entries to return within a folder. If the number of files in the directory exceeds this limit, an exception is raised. The server will return at max 25,000 files within a folder.
-
hash: Every directory listing has a hash parameter attached that can then be passed back into this function later to save on bandwidth. Rather than returning an unchanged folder’s contents, if the hash matches a DropboxNotModified exception is raised.
-
rev: Optional. The revision of the file to retrieve the metadata for. This parameter only applies for files. If omitted, you’ll receive the most recent revision metadata.
-
include_deleted: Specifies whether to include deleted files in metadata results.
Returns:
-
A Hash object with the metadata of the file or folder (and contained files if appropriate). For a detailed description of what this call returns, visit: www.dropbox.com/developers/reference/api#metadata
1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 |
# File 'lib/dropbox_sdk.rb', line 1109 def (path, file_limit=25000, list=true, hash=nil, rev=nil, include_deleted=false) params = { "file_limit" => file_limit.to_s, "list" => list.to_s, "include_deleted" => include_deleted.to_s, "hash" => hash, "rev" => rev, } response = @session.do_get "/metadata/#{@root}#{format_path(path)}", params if response.kind_of? Net::HTTPRedirection raise DropboxNotModified.new("metadata not modified") end Dropbox::parse_response(response) end |