var storages = native_.getResultObject(result);
for (var i = 0; i < storages.length; ++i) {
cacheStorages.push({
+ path: storages[i].path,
label: storages[i].name,
type: storages[i].type,
state: storages[i].state,
} else {
//If path token is not present in cache then it is invalid
_fileRealPath = undefined;
+ // check storages
+ for (var j = 0; j < cacheStorages.length; ++j) {
+ if (cacheStorages[j].label === _pathTokens[0] && (
+ cacheStorages[j].state === undefined ||
+ cacheStorages[j].state === FileSystemStorageState.MOUNTED)) {
+ _fileRealPath = cacheStorages[j].path;
+ for (var i = 1; i < _pathTokens.length; ++i) {
+ _fileRealPath += '/' + _pathTokens[i];
+ }
+ break;
+ }
+ }
}
} else {
_fileRealPath = aPath;
}
};
- native_.call('File_stat', data, callback);
+ var ret = native_.call('File_stat', data, callback);
+ if (native_.isFailure(ret)) {
+ throw native_.getErrorObject(ret);
+ }
};
FileSystemManager.prototype.getStorage = function(label, onsuccess, onerror) {