cordova-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From i..@apache.org
Subject [29/37] git commit: Android: Allow file:/ URLs
Date Wed, 23 Apr 2014 18:57:25 GMT
Android: Allow file:/ URLs


Project: http://git-wip-us.apache.org/repos/asf/cordova-plugin-file/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-plugin-file/commit/162180bc
Tree: http://git-wip-us.apache.org/repos/asf/cordova-plugin-file/tree/162180bc
Diff: http://git-wip-us.apache.org/repos/asf/cordova-plugin-file/diff/162180bc

Branch: refs/heads/master
Commit: 162180bca42f5d9befb5c2071c7cc2fd35ef9932
Parents: b1cc226
Author: Ian Clelland <iclelland@chromium.org>
Authored: Tue Apr 15 15:22:53 2014 -0400
Committer: Ian Clelland <iclelland@chromium.org>
Committed: Tue Apr 15 15:22:53 2014 -0400

----------------------------------------------------------------------
 src/android/FileUtils.java | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-plugin-file/blob/162180bc/src/android/FileUtils.java
----------------------------------------------------------------------
diff --git a/src/android/FileUtils.java b/src/android/FileUtils.java
index c34fd72..a7e86fa 100644
--- a/src/android/FileUtils.java
+++ b/src/android/FileUtils.java
@@ -568,7 +568,10 @@ public class FileUtils extends CordovaPlugin {
     	}
     	
 		/* Backwards-compatibility: Check for file:// urls */
-    	if (url.startsWith("file://")) {
+        if (url.startsWith("file:/")) {
+            if (!url.startsWith("file://")) {
+                url = "file:///" + url.substring(6);
+            }
             String decoded = URLDecoder.decode(url, "UTF-8");
     		/* This looks like a file url. Get the path, and see if any handlers recognize it.
*/
     		String path;


Mime
View raw message