incubator-callback-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bows...@apache.org
Subject [1/50] git commit: Fixing issue with FileTransfer.upload when the passed in url contains a ?
Date Tue, 03 Jan 2012 18:57:07 GMT
Updated Branches:
  refs/heads/master 1f2f9a02d -> c66142d6b


Fixing issue with FileTransfer.upload when the passed in url contains a ?


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

Branch: refs/heads/master
Commit: c66142d6b8ae9385505a3ea5ccd9896ece0edde1
Parents: 5fac30e
Author: macdonst <simon.macdonald@gmail.com>
Authored: Wed Jan 4 00:47:22 2012 +0800
Committer: macdonst <simon.macdonald@gmail.com>
Committed: Wed Jan 4 00:48:29 2012 +0800

----------------------------------------------------------------------
 framework/src/com/phonegap/FileTransfer.java |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-cordova-android/blob/c66142d6/framework/src/com/phonegap/FileTransfer.java
----------------------------------------------------------------------
diff --git a/framework/src/com/phonegap/FileTransfer.java b/framework/src/com/phonegap/FileTransfer.java
index 8e0e1e0..0c3132f 100644
--- a/framework/src/com/phonegap/FileTransfer.java
+++ b/framework/src/com/phonegap/FileTransfer.java
@@ -429,7 +429,12 @@ public class FileTransfer extends Plugin {
             return ctx.getContentResolver().openInputStream(uri);
         }
         else if (path.startsWith("file://")) {
-            return new FileInputStream(path.substring(7));
+            int question = path.indexOf("?");
+            if (question == -1) {
+                return new FileInputStream(path.substring(7));
+            } else {
+                return new FileInputStream(path.substring(7, question));
+            }
         }
         else {
             return new FileInputStream(path);


Mime
View raw message