| Class | DropboxClient |
| In: |
build/dropbox-ruby-sdk-dist/lib/dropbox_sdk.rb
|
| Parent: | Object |
This is the Dropbox Client API you‘ll be working with most often. You need to give it a DropboxSession which has already been authorized, or which it can authorize.
| RESERVED_CHARACTERS | = | /[^a-zA-Z0-9\-\.\_\~\/]/ | From the oauth spec plus "/". Slash should not be ecsaped |
Initialize a new DropboxClient. You need to give it a session which has been authorized. See documentation on DropboxSession for how to authorize it.
Returns account info in a Hash object
For a detailed description of what this call returns, visit: www.dropbox.com/developers/reference/api#account-info
Adds the file referenced by the copy ref to the specified path
Args:
Returns:
Creates and returns a copy ref for a specific file. The copy ref can be used to instantly copy that file to the Dropbox of another account.
Args:
Returns:
{"expires"=>"Fri, 31 Jan 2042 21:01:05 +0000", "copy_ref"=>"z1X6ATl6aWtzOGq0c3g5Ng"}
A way of letting you keep a local representation of the Dropbox folder heirarchy. You can periodically call delta() to get a list of "delta entries", which are instructions on how to update your local state to match the server‘s state.
Arguments:
Returns: A hash with three fields.
Delta Entries: Each entry is a 2-item list of one of following forms:
Remember: Dropbox treats file names in a case-insensitive but case-preserving way. To facilitate this, the path strings above are lower-cased versions of the actual path. The metadata dicts have the original, case-preserved path.
Copy a file or folder to a new location.
Arguments:
Returns:
Create a folder.
Arguments:
Returns:
Deletes a file
Arguments:
Returns:
Moves a file
Arguments:
Returns:
Returns a ChunkedUploader object.
Args:
Download a file
Args:
Returns:
Returns a direct link to a media file All of Dropbox‘s API methods require OAuth, which may cause problems in situations where an application expects to be able to hit a URL multiple times (for example, a media player seeking around a video file). This method creates a time-limited URL that can be accessed without any authentication.
Arguments:
Returns:
{'url': 'https://dl.dropbox.com/0/view/wvxv1fw6on24qw7/file.mov', 'expires': 'Thu, 16 Sep 2011 01:01:25 +0000'}
Retrives metadata for a file or folder
Arguments:
Returns:
Uploads a file to a server. This uses the HTTP PUT upload method for simplicity
Arguments:
Returns:
Simple Example
client = DropboxClient(session, :app_folder)
#session is a DropboxSession I've already authorized
client.put_file('/test_file_on_dropbox', open('/tmp/test_file'))
This will upload the "/tmp/test_file" from my computer into the root of my App‘s app folder and call it "test_file_on_dropbox". The file will not overwrite any pre-existing file.
Restore a file to a previous revision.
Arguments:
Returns:
Retrive revisions of a file
Arguments:
Returns:
Search directory for filenames matching query
Arguments:
Returns:
Get a URL to share a media file Shareable links created on Dropbox are time-limited, but don‘t require any authentication, so they can be given out freely. The time limit should allow at least a day of shareability, though users have the ability to disable a link from their account if they like.
Arguments:
Returns:
{'url': 'http://www.dropbox.com/s/m/a2mbDa2', 'expires': 'Thu, 16 Sep 2011 01:01:25 +0000'}
For a detailed description of what this call returns, visit:
https://www.dropbox.com/developers/reference/api#shares
Download a thumbnail for an image.
Arguments:
Returns: