storage: make remove and removeDir async
This commit is contained in:
@@ -119,24 +119,21 @@ function listDir(apiConfig, dir, batchSize, iteratorCallback, callback) {
|
||||
callback(new BoxError(BoxError.NOT_IMPLEMENTED, 'listDir is not implemented'));
|
||||
}
|
||||
|
||||
function remove(apiConfig, filename, callback) {
|
||||
async function remove(apiConfig, filename) {
|
||||
assert.strictEqual(typeof apiConfig, 'object');
|
||||
assert.strictEqual(typeof filename, 'string');
|
||||
assert.strictEqual(typeof callback, 'function');
|
||||
|
||||
// Result: none
|
||||
|
||||
callback(new BoxError(BoxError.NOT_IMPLEMENTED, 'remove is not implemented'));
|
||||
throw new BoxError(BoxError.NOT_IMPLEMENTED, 'remove is not implemented');
|
||||
}
|
||||
|
||||
function removeDir(apiConfig, pathPrefix) {
|
||||
async function removeDir(apiConfig, pathPrefix, progressCallback) {
|
||||
assert.strictEqual(typeof apiConfig, 'object');
|
||||
assert.strictEqual(typeof pathPrefix, 'string');
|
||||
assert.strictEqual(typeof progressCallback, 'function');
|
||||
|
||||
// Result: none
|
||||
var events = new EventEmitter();
|
||||
process.nextTick(function () { events.emit('done', new BoxError(BoxError.NOT_IMPLEMENTED, 'removeDir is not implemented')); });
|
||||
return events;
|
||||
throw new BoxError(BoxError.NOT_IMPLEMENTED, 'removeDir is not implemented');
|
||||
}
|
||||
|
||||
async function remount(apiConfig) {
|
||||
|
||||
Reference in New Issue
Block a user