You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by bo...@apache.org on 2012/02/20 22:01:00 UTC

[11/21] android commit: Need to add/trim file:// where applicable

Need to add/trim file:// where applicable


Project: http://git-wip-us.apache.org/repos/asf/incubator-cordova-android/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-cordova-android/commit/b4d1ca61
Tree: http://git-wip-us.apache.org/repos/asf/incubator-cordova-android/tree/b4d1ca61
Diff: http://git-wip-us.apache.org/repos/asf/incubator-cordova-android/diff/b4d1ca61

Branch: refs/heads/master
Commit: b4d1ca61812a5aa8bfe2cc767b009aefa40c9930
Parents: 657faaf
Author: Fil Maj <fi...@nitobi.com>
Authored: Thu Feb 16 15:33:19 2012 -0800
Committer: Joe Bowser <bo...@apache.org>
Committed: Mon Feb 20 11:04:36 2012 -0800

----------------------------------------------------------------------
 framework/src/org/apache/cordova/FileUtils.java |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-cordova-android/blob/b4d1ca61/framework/src/org/apache/cordova/FileUtils.java
----------------------------------------------------------------------
diff --git a/framework/src/org/apache/cordova/FileUtils.java b/framework/src/org/apache/cordova/FileUtils.java
index c347806..ec81fc7 100755
--- a/framework/src/org/apache/cordova/FileUtils.java
+++ b/framework/src/org/apache/cordova/FileUtils.java
@@ -687,6 +687,9 @@ public class FileUtils extends Plugin {
         if (fileName.startsWith("/")) {
             fp = new File(fileName);
         } else {
+            if (dirPath.startsWith("file://")) {
+                dirPath = dirPath.substring(7);
+            }
             fp = new File(dirPath + File.separator + fileName);
         }
         return fp;
@@ -819,7 +822,7 @@ public class FileUtils extends Plugin {
         entry.put("isFile", file.isFile());
         entry.put("isDirectory", file.isDirectory());
         entry.put("name", file.getName());
-        entry.put("fullPath", file.getAbsolutePath());
+        entry.put("fullPath", "file://" + file.getAbsolutePath());
         // I can't add the next thing it as it would be an infinite loop
         //entry.put("filesystem", null);