From c099c653658f63fff1e3db6cd25898bdc347e81f Mon Sep 17 00:00:00 2001 From: Fil Maj Date: Thu, 16 Feb 2012 17:31:07 -0800 Subject: [PATCH] remove file:// protocol from various fileutils remove methods --- framework/src/org/apache/cordova/FileUtils.java | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/framework/src/org/apache/cordova/FileUtils.java b/framework/src/org/apache/cordova/FileUtils.java index 3646be6b..87be54f9 100755 --- a/framework/src/org/apache/cordova/FileUtils.java +++ b/framework/src/org/apache/cordova/FileUtils.java @@ -555,6 +555,10 @@ public class FileUtils extends Plugin { * @throws FileExistsException */ private boolean removeRecursively(String filePath) throws FileExistsException { + if (filePath.startsWith("file://")) { + filePath = filePath.substring(7); + } + File fp = new File(filePath); // You can't delete the root directory. @@ -596,6 +600,10 @@ public class FileUtils extends Plugin { * @throws InvalidModificationException */ private boolean remove(String filePath) throws NoModificationAllowedException, InvalidModificationException { + if (filePath.startsWith("file://")) { + filePath = filePath.substring(7); + } + File fp = new File(filePath); // You can't delete the root directory.