1
0
mirror of https://github.com/laurent22/joplin.git synced 2025-11-26 22:41:17 +02:00

fetchblob

This commit is contained in:
Laurent Cozic
2017-07-06 22:30:45 +01:00
parent 40ed3216a3
commit 8ee0c38f86
12 changed files with 130 additions and 49 deletions

View File

@@ -85,15 +85,21 @@ class FileApiDriverOneDrive {
}
}
async get(path) {
let content = null;
async get(path, options = null) {
if (!options) options = {};
try {
content = await this.api_.execText('GET', this.makePath_(path) + ':/content');
if (options.target == 'file') {
let response = await this.api_.exec('GET', this.makePath_(path) + ':/content', null, null, options);
return response;
} else {
let content = await this.api_.execText('GET', this.makePath_(path) + ':/content');
return content;
}
} catch (error) {
if (error.code == 'itemNotFound') return null;
throw error;
}
return content;
}
async mkdir(path) {