From 4605992cdf98341dffab9d270ea1845ed9f3acb3 Mon Sep 17 00:00:00 2001 From: coderaiser Date: Fri, 6 Dec 2013 13:40:31 +0000 Subject: [PATCH] feature(dropbox) add read --- lib/client/storage/_dropbox.js | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/lib/client/storage/_dropbox.js b/lib/client/storage/_dropbox.js index 612ab797..6babc146 100644 --- a/lib/client/storage/_dropbox.js +++ b/lib/client/storage/_dropbox.js @@ -130,6 +130,23 @@ var CloudCmd, Util, DOM, Dropbox, cb, Client; }); }; + this.read = function(path, callback) { + Client.stat(path, function(error, stat) { + var msg, read; + + if (error) + msg = error.responseText; + else { + if (stat.isFile) + read = DropBoxStore.readFile; + else + read = DropBoxStore.readDir; + + read(path, callback); + } + }); + }; + this.writeFile = function(name, data, callback) { Client.writeFile(name, data, function(error, data) { var msg;