incubator-callback-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From macdo...@apache.org
Subject android commit: CB-978: FileTransfer.upload from a directory with a space fails
Date Thu, 28 Jun 2012 15:57:50 GMT
Updated Branches:
  refs/heads/master a2816e31c -> 87b81e53f


CB-978: FileTransfer.upload from a directory with a space fails


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

Branch: refs/heads/master
Commit: 87b81e53f00dcd93ebdbdf2f4bdb0c6d950f4f1a
Parents: a2816e3
Author: macdonst <simon.macdonald@gmail.com>
Authored: Thu Jun 28 11:57:06 2012 -0400
Committer: macdonst <simon.macdonald@gmail.com>
Committed: Thu Jun 28 11:57:06 2012 -0400

----------------------------------------------------------------------
 framework/src/org/apache/cordova/FileTransfer.java |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-cordova-android/blob/87b81e53/framework/src/org/apache/cordova/FileTransfer.java
----------------------------------------------------------------------
diff --git a/framework/src/org/apache/cordova/FileTransfer.java b/framework/src/org/apache/cordova/FileTransfer.java
index 824ad02..2b2620b 100644
--- a/framework/src/org/apache/cordova/FileTransfer.java
+++ b/framework/src/org/apache/cordova/FileTransfer.java
@@ -29,6 +29,7 @@ import java.io.InputStream;
 import java.net.HttpURLConnection;
 import java.net.MalformedURLException;
 import java.net.URL;
+import java.net.URLDecoder;
 import java.security.cert.CertificateException;
 import java.security.cert.X509Certificate;
 import java.util.Iterator;
@@ -73,7 +74,7 @@ public class FileTransfer extends Plugin {
         String source = null;
         String target = null;
         try {
-            source = args.getString(0);
+            source = URLDecoder.decode(args.getString(0));
             target = args.getString(1);
         } catch (JSONException e) {
             Log.d(LOG_TAG, "Missing source or target");
@@ -321,7 +322,7 @@ public class FileTransfer extends Plugin {
         } catch (Throwable t) {
             // Shouldn't happen, but will
             JSONObject error = createFileTransferError(CONNECTION_ERR, source, target, conn);
-            Log.wtf(LOG_TAG, error.toString(), t);
+            Log.e(LOG_TAG, error.toString(), t);
             return new PluginResult(PluginResult.Status.IO_EXCEPTION, error);
         } finally {
             if (conn != null) {


Mime
View raw message