mirror of
https://github.com/coderaiser/cloudcmd.git
synced 2026-01-23 18:55:26 +00:00
feature(dropbox) add read
This commit is contained in:
parent
2cb28da206
commit
4605992cdf
1 changed files with 17 additions and 0 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue