You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by ag...@apache.org on 2014/04/23 04:23:38 UTC
git commit: CB-6494 android: Fix upload of KitKat content URIs
Repository: cordova-plugin-file-transfer
Updated Branches:
refs/heads/dev eb63c466e -> 98e5da556
CB-6494 android: Fix upload of KitKat content URIs
FileTransfer was double-decoding the source URL.
Project: http://git-wip-us.apache.org/repos/asf/cordova-plugin-file-transfer/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-plugin-file-transfer/commit/98e5da55
Tree: http://git-wip-us.apache.org/repos/asf/cordova-plugin-file-transfer/tree/98e5da55
Diff: http://git-wip-us.apache.org/repos/asf/cordova-plugin-file-transfer/diff/98e5da55
Branch: refs/heads/dev
Commit: 98e5da556f11ff04d532d2f7569f4ef7bd786ba1
Parents: eb63c46
Author: Andrew Grieve <ag...@chromium.org>
Authored: Tue Apr 22 22:16:53 2014 -0400
Committer: Andrew Grieve <ag...@chromium.org>
Committed: Tue Apr 22 22:16:53 2014 -0400
----------------------------------------------------------------------
src/android/FileTransfer.java | 9 +--------
1 file changed, 1 insertion(+), 8 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cordova-plugin-file-transfer/blob/98e5da55/src/android/FileTransfer.java
----------------------------------------------------------------------
diff --git a/src/android/FileTransfer.java b/src/android/FileTransfer.java
index e370c5f..eeed2f6 100644
--- a/src/android/FileTransfer.java
+++ b/src/android/FileTransfer.java
@@ -28,10 +28,8 @@ import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.OutputStream;
-import java.io.UnsupportedEncodingException;
import java.net.HttpURLConnection;
import java.net.URLConnection;
-import java.net.URLDecoder;
import java.security.cert.CertificateException;
import java.security.cert.X509Certificate;
import java.util.HashMap;
@@ -177,12 +175,7 @@ public class FileTransfer extends CordovaPlugin {
String target = args.getString(1);
if (action.equals("upload")) {
- try {
- source = URLDecoder.decode(source, "UTF-8");
- upload(source, target, args, callbackContext);
- } catch (UnsupportedEncodingException e) {
- callbackContext.sendPluginResult(new PluginResult(PluginResult.Status.MALFORMED_URL_EXCEPTION, "UTF-8 error."));
- }
+ upload(source, target, args, callbackContext);
} else {
download(source, target, args, callbackContext);
}