From: Pawel Andruszkiewicz
Date: Wed, 29 Jul 2015 09:43:01 +0000 (+0200)
Subject: [Filesystem] Report NotFound error if virtual root is invalid.
X-Git-Tag: submit/tizen_tv/20150803.021740^2^2~7^2
X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=19207a3589d82ccc6fb961e4a9992a42d887c6e9;p=platform%2Fcore%2Fapi%2Fwebapi-plugins.git
[Filesystem] Report NotFound error if virtual root is invalid.
Fixes: UTC_filesystem_resolve_invalid_pram_location_N_003
[Verification] [Verification] Wearable service UTC: 94/94
Mobile TCT: 289/289
Change-Id: I16f8e450eefbc6389591c3e08b1d1b478f65faa1
Signed-off-by: Pawel Andruszkiewicz
---
diff --git a/src/filesystem/js/file_system_manager.js b/src/filesystem/js/file_system_manager.js
index 161a51f9..e5e3c8b8 100755
--- a/src/filesystem/js/file_system_manager.js
+++ b/src/filesystem/js/file_system_manager.js
@@ -65,6 +65,17 @@ FileSystemManager.prototype.resolve = function(location, onsuccess, onerror, mod
}
var _realPath = commonFS_.toRealPath(args.location);
+
+ if (!_realPath) {
+ // invalid real path means that virtual root does not exist
+ setTimeout(function() {
+ native_.callIfPossible(args.onerror,
+ new WebAPIException(WebAPIException.NOT_FOUND_ERR,
+ 'Specified virtual root does not exist.'));
+ }, 0);
+ return;
+ }
+
var _isLocationAllowed = commonFS_.isLocationAllowed(_realPath);
if (args.mode !== 'r' && !_isLocationAllowed) {