From d8e4a87c421840ff6f1b46e1441f88921347a181 Mon Sep 17 00:00:00 2001 From: Bartek Przybylski Date: Mon, 14 May 2012 16:56:54 +0200 Subject: [PATCH] fix crash if download file has space in it --- src/eu/alefzero/webdav/WebdavClient.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/eu/alefzero/webdav/WebdavClient.java b/src/eu/alefzero/webdav/WebdavClient.java index 880995da98..1416d17bf2 100644 --- a/src/eu/alefzero/webdav/WebdavClient.java +++ b/src/eu/alefzero/webdav/WebdavClient.java @@ -22,6 +22,7 @@ import java.io.File; import java.io.FileOutputStream; import java.io.IOException; import java.net.URLDecoder; +import java.net.URLEncoder; import org.apache.commons.httpclient.Credentials; import org.apache.commons.httpclient.HttpClient; @@ -71,12 +72,13 @@ public class WebdavClient extends HttpClient { //HttpGet get = new HttpGet(mUri.toString() + filepath.replace(" ", "%20")); Log.e("ASD", mUri.toString() + URLDecoder.decode(filepath) + ""); - GetMethod get = new GetMethod(mUri.toString() + URLDecoder.decode(filepath)); + GetMethod get = new GetMethod(mUri.toString() + URLEncoder.encode(filepath)); // get.setHeader("Host", mUri.getHost()); // get.setHeader("User-Agent", "Android-ownCloud"); - try { + try { + Log.e("ASD", get.toString()); int status = executeMethod(get); if (status != HttpStatus.SC_OK) { return false;