You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by ia...@apache.org on 2014/04/15 21:23:16 UTC
git commit: Android: Allow file:/ URLs
Repository: cordova-plugin-file
Updated Branches:
refs/heads/dev b1cc2261c -> 162180bca
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/dev
Commit: 162180bca42f5d9befb5c2071c7cc2fd35ef9932
Parents: b1cc226
Author: Ian Clelland <ic...@chromium.org>
Authored: Tue Apr 15 15:22:53 2014 -0400
Committer: Ian Clelland <ic...@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;