[File] Added undocumented function for backward compatibility.
authorPawel Andruszkiewicz <p.andruszkie@samsung.com>
Fri, 20 Nov 2015 13:37:27 +0000 (14:37 +0100)
committerPawel Andruszkiewicz <p.andruszkie@samsung.com>
Fri, 20 Nov 2015 14:25:04 +0000 (23:25 +0900)
[Verification] Pass rate of file module did not change.
               All tests for file transfer pass.

Change-Id: I92bb70523d4e6b2b6cf2b902dd5e2baee68788b5
Signed-off-by: Pawel Andruszkiewicz <p.andruszkie@samsung.com>
src/file/js/resolveLocalFileSystemURI.js

index 54b2fc8..9dabdc5 100644 (file)
@@ -18,6 +18,8 @@
 cordova.define('cordova-plugin-file.tizen.resolveLocalFileSystemURI', function(require, exports, module) {
 // TODO: remove -> end
 
+var filePrefix = 'file://';
+
 module.exports = {
   resolveLocalFileSystemURI: function(successCallback, errorCallback, args) {
     var path = rootsUtils.internalUrlToNativePath(args[0]);
@@ -41,7 +43,19 @@ module.exports = {
     }
 
     tizen.filesystem.resolve(path, onResolve, onError, 'r');
-  }
+  },
+  _getLocalFilesystemPath: function(successCallback, errorCallback, args) {
+    var path = rootsUtils.internalUrlToNativePath(args[0]);
+
+    if (!path) {
+      errorCallback && errorCallback(FileError.ENCODING_ERR);
+    } else {
+      if (0 === path.indexOf(filePrefix)) {
+        path = path.substring(filePrefix.length);
+      }
+      successCallback && successCallback(path);
+    }
+  },
 };
 
 //TODO: remove when added to public cordova repository -> begin