Revert "[Filesystem] Fixed for copying, deleting and moving files/dirs."
authorHyunJin Park <hj.na.park@samsung.com>
Thu, 10 Sep 2015 09:50:20 +0000 (18:50 +0900)
committerHyunJin Park <hj.na.park@samsung.com>
Thu, 10 Sep 2015 09:50:20 +0000 (18:50 +0900)
This reverts commit 904977b3c574276de2187e3302cc3cc6a08e99e6.

Change-Id: I25eb704a920a132f6d8b6dee14c3f566cc8888c2

src/filesystem/js/common.js
src/filesystem/js/file.js

index 1bc8ed3..38f5a58 100755 (executable)
@@ -218,8 +218,7 @@ var commonFS_ = (function() {
   }
 
   function f_isSubDir(fullPathToCheck, fullPath) {
-    var realFullPath = toRealPath(fullPath);
-    return ((-1 !== fullPathToCheck.indexOf(realFullPath)) && (fullPathToCheck !== realFullPath));
+    return (-1 !== fullPathToCheck.indexOf(toRealPath(fullPath)));
   };
 
   function f_isCorrectRelativePath(relativePath) {
index dc68afb..8f3e712 100755 (executable)
@@ -726,16 +726,6 @@ File.prototype.deleteDirectory = function(directoryPath, recursive, onsuccess, o
   }
 
   var _myPath = commonFS_.toRealPath(args.directoryPath);
-
-  if (_myPath !== undefined && !commonFS_.f_isSubDir(_myPath, this.fullPath)) {
-    var m1 = 'Deleted directory should be under the current directory: ' + this.fullPath;
-    setTimeout(function() {
-      native_.callIfPossible(args.onerror,
-          new WebAPIException(WebAPIException.INVALID_VALUES_ERR, m1));
-    }, 0);
-    return;
-  }
-
   var _result = native_.callSync('File_statSync', {location: _myPath});
   if (native_.isFailure(_result)) {
     setTimeout(function() {