You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by pu...@apache.org on 2014/04/29 02:16:28 UTC

[1/2] git commit: fix the Windows 8 implementation of the getFile method

Repository: cordova-plugin-file
Updated Branches:
  refs/heads/master 69e465a4f -> 272d27ef5


fix the Windows 8  implementation of the getFile method

The storageFolder.getFileAsync(name) does not accept relative paths, only a simple file name...


Project: http://git-wip-us.apache.org/repos/asf/cordova-plugin-file/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-plugin-file/commit/22a42c97
Tree: http://git-wip-us.apache.org/repos/asf/cordova-plugin-file/tree/22a42c97
Diff: http://git-wip-us.apache.org/repos/asf/cordova-plugin-file/diff/22a42c97

Branch: refs/heads/master
Commit: 22a42c97dfe4b454041ae710f2bcb03c02ca7d4f
Parents: 3d7eb3e
Author: Melvyn <ml...@gismartware.com>
Authored: Tue Apr 8 15:33:42 2014 +0200
Committer: Melvyn <ml...@gismartware.com>
Committed: Tue Apr 8 15:33:42 2014 +0200

----------------------------------------------------------------------
 src/windows8/FileProxy.js | 15 +++++++++++++--
 1 file changed, 13 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-plugin-file/blob/22a42c97/src/windows8/FileProxy.js
----------------------------------------------------------------------
diff --git a/src/windows8/FileProxy.js b/src/windows8/FileProxy.js
index e564626..df79cef 100644
--- a/src/windows8/FileProxy.js
+++ b/src/windows8/FileProxy.js
@@ -376,10 +376,21 @@ module.exports = {
     },
 
     getFile:function(win,fail,args) {
-        var fullPath = args[0];
-        var path = args[1];
+		//not sure why, but it won't work with normal slashes...
+		var fullPath = args[0].replace(/\//g, '\\');
+        var path = args[1].replace(/\//g, '\\');
         var options = args[2];
 
+        var completePath = fullPath + '\\' + path;
+		//handles trailing slash and leading slash, or just one or the other
+        completePath = completePath.replace(/\\\\\\/g, '/').replace(/\\\\/g, '\\');
+
+        var fileName = completePath.substring(completePath.lastIndexOf('\\'));
+		
+		//final adjustment
+        fullPath = completePath.substring(0, completePath.lastIndexOf('\\'));
+        path = fileName.replace(/\\/g, '');
+
         var flag = "";
         if (options !== null) {
             flag = new Flags(options.create, options.exclusive);


[2/2] git commit: Merge branch 'dev' of https://github.com/yaurthek/cordova-plugin-file

Posted by pu...@apache.org.
Merge branch 'dev' of https://github.com/yaurthek/cordova-plugin-file


Project: http://git-wip-us.apache.org/repos/asf/cordova-plugin-file/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-plugin-file/commit/272d27ef
Tree: http://git-wip-us.apache.org/repos/asf/cordova-plugin-file/tree/272d27ef
Diff: http://git-wip-us.apache.org/repos/asf/cordova-plugin-file/diff/272d27ef

Branch: refs/heads/master
Commit: 272d27ef5b4ed030f735181a0e26365829467602
Parents: 69e465a 22a42c9
Author: Jesse MacFadyen <pu...@gmail.com>
Authored: Mon Apr 28 17:16:34 2014 -0700
Committer: Jesse MacFadyen <pu...@gmail.com>
Committed: Mon Apr 28 17:16:34 2014 -0700

----------------------------------------------------------------------
 src/windows8/FileProxy.js | 15 +++++++++++++--
 1 file changed, 13 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-plugin-file/blob/272d27ef/src/windows8/FileProxy.js
----------------------------------------------------------------------