You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by bc...@apache.org on 2012/02/17 23:58:02 UTC

[8/16] 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/6c48c6a3
Tree: http://git-wip-us.apache.org/repos/asf/incubator-cordova-android/tree/6c48c6a3
Diff: http://git-wip-us.apache.org/repos/asf/incubator-cordova-android/diff/6c48c6a3

Branch: refs/heads/master
Commit: 6c48c6a3a1fef6bb29c4d75da65ef97ba2971c01
Parents: 7ee135e
Author: Fil Maj <fi...@nitobi.com>
Authored: Thu Feb 16 15:33:19 2012 -0800
Committer: Fil Maj <fi...@nitobi.com>
Committed: Thu Feb 16 15:33:19 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/6c48c6a3/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);