Permalink
Browse files

Fixed put didn't work.

Because DropboxClient.put conflicted with a convenience methods, it didn't work. I renamed the convenience methods.

Conflicts:

	lib/dropbox-node.js
  • Loading branch information...
1 parent 6916c29 commit 3436c28ebb0a4bac58e2d378b76e3e747245bbb7 @snakamura snakamura committed Jun 26, 2012
Showing with 14 additions and 14 deletions.
  1. +14 −14 lib/dropbox-node.js
View
28 lib/dropbox-node.js
@@ -74,7 +74,7 @@ DropboxClient.prototype.request =
// Convenience methods
['get', 'post', 'put'].forEach(function(method) {
- DropboxClient.prototype[method] = function(uri, optargs, body, callback) {
+ DropboxClient.prototype['_' + method] = function(uri, optargs, body, callback) {
return this.request(method, uri, optargs, body, callback);
};
});
@@ -91,7 +91,7 @@ DropboxClient.prototype.getAccessToken = function(email, pwd, cb) {
var uri = API_URI + '/token?' +
querystring.stringify({email: email, password: pwd});
var self = this;
- this.get(uri, {}, function(err, data) {
+ this._get(uri, {}, function(err, data) {
if (err) return cb(err);
// Store the key pair and fire callback.
self.access_token = data.token;
@@ -107,7 +107,7 @@ DropboxClient.prototype.getAccountInfo = function(optargs, cb) {
var uri = API_URI + '/account/info/' +
(optargs.status_in_response ? '?status_in_response=' +
optargs.status_in_response : '');
- this.get(uri, optargs, cb);
+ this._get(uri, optargs, cb);
}
@@ -124,7 +124,7 @@ DropboxClient.prototype.createAccount = function(email, first_name, last_name
}
var uri = API_URI + '/account?' +
querystring.stringify(params);
- this.get(uri, {}, cb);
+ this._get(uri, {}, cb);
}
@@ -135,7 +135,7 @@ DropboxClient.prototype.getFile = function(path, optargs, cb) {
else if (!optargs) optargs = {};
var uri = CONTENT_API_URI + '/files/dropbox/' + escapePath(path) +
(optargs.rev ? '?rev=' + optargs.rev : '');
- return this.get(uri, optargs, optargs.range, cb);
+ return this._get(uri, optargs, optargs.range, cb);
}
@@ -157,7 +157,7 @@ DropboxClient.prototype.put = function(content, path, optargs, cb) {
if (typeof optargs == 'function') cb = optargs, optargs = {};
var uri = CONTENT_API_URI + '/files_put/dropbox/' + escapePath(path) +
'?' + stringifyParams(optargs);
- this.put(uri, optargs, content, cb);
+ this._put(uri, optargs, content, cb);
}
@@ -167,7 +167,7 @@ DropboxClient.prototype.getMetadata = function(path, optargs, cb) {
if (typeof optargs == 'function') cb = optargs, optargs = {};
var uri = API_URI + '/metadata/dropbox/' + escapePath(path) + '?' +
stringifyParams(optargs);
- this.get(uri, optargs, cb);
+ this._get(uri, optargs, cb);
}
@@ -179,7 +179,7 @@ DropboxClient.prototype.getThumbnail = function(path, optargs, cb) {
optargs = optargs || {};
var uri = CONTENT_API_URI + '/thumbnails/dropbox/' + escapePath(path) + '?' +
stringifyParams(optargs);
- return this.get(uri, optargs, cb);
+ return this._get(uri, optargs, cb);
}
@@ -195,7 +195,7 @@ DropboxClient.prototype.copy = function(from_path, to_path, optargs, cb) {
querystring.stringify({root: 'dropbox'
, from_path: from_path
, to_path: to_path});
- this.get(uri, optargs, cb);
+ this._get(uri, optargs, cb);
}
@@ -207,7 +207,7 @@ DropboxClient.prototype.createFolder = function(path, optargs, cb) {
var uri = API_URI + '/fileops/create_folder?' +
querystring.stringify({root: 'dropbox'
, path: path});
- this.get(uri, optargs, cb);
+ this._get(uri, optargs, cb);
}
@@ -218,7 +218,7 @@ DropboxClient.prototype.deleteItem = function(path, optargs, cb) {
if (typeof optargs == 'function') cb = optargs, optargs = {};
var uri = API_URI + '/fileops/delete?' +
querystring.stringify({root: 'dropbox', path: path});
- this.get(uri, optargs, cb);
+ this._get(uri, optargs, cb);
}
@@ -231,7 +231,7 @@ DropboxClient.prototype.move = function(from_path, to_path, optargs, cb) {
querystring.stringify({root: 'dropbox'
, from_path: from_path
, to_path: to_path});
- this.get(uri, optargs, cb);
+ this._get(uri, optargs, cb);
}
@@ -242,7 +242,7 @@ DropboxClient.prototype.search = function(path, query, optargs, cb) {
optargs.query = query;
var uri = API_URI + '/search/dropbox/' + escapePath(path) + '?' +
stringifyParams(optargs);
- this.get(uri, optargs, cb);
+ this._get(uri, optargs, cb);
}
@@ -263,7 +263,7 @@ DropboxClient.prototype.delta = function(cursor, optargs, cb) {
var uri = API_URI + '/delta' +
(cursor ? '?' + querystring.stringify({cursor: cursor}) : '')
- this.post(uri, optargs, cb);
+ this._post(uri, optargs, cb);
}

0 comments on commit 3436c28

Please sign in to comment.