From 6c48c6a3a1fef6bb29c4d75da65ef97ba2971c01 Mon Sep 17 00:00:00 2001 From: Fil Maj Date: Thu, 16 Feb 2012 15:33:19 -0800 Subject: [PATCH] Need to add/trim file:// where applicable --- framework/src/org/apache/cordova/FileUtils.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/framework/src/org/apache/cordova/FileUtils.java b/framework/src/org/apache/cordova/FileUtils.java index c3478065..ec81fc71 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);