incubator-callback-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bcur...@apache.org
Subject [6/16] android commit: remove file:// protocol from various fileutils remove methods
Date Fri, 17 Feb 2012 22:58:02 GMT
remove file:// protocol from various fileutils remove methods


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/7e4158ce
Tree: http://git-wip-us.apache.org/repos/asf/incubator-cordova-android/tree/7e4158ce
Diff: http://git-wip-us.apache.org/repos/asf/incubator-cordova-android/diff/7e4158ce

Branch: refs/heads/master
Commit: 7e4158ce94f59e15ba9a22778c404d1b388c3c98
Parents: 0ba803f
Author: Fil Maj <filip.maj@nitobi.com>
Authored: Thu Feb 16 17:31:07 2012 -0800
Committer: Fil Maj <filip.maj@nitobi.com>
Committed: Thu Feb 16 17:31:07 2012 -0800

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


http://git-wip-us.apache.org/repos/asf/incubator-cordova-android/blob/7e4158ce/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 3646be6..87be54f 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.


Mime
View raw message