fix crash if download file has space in it
[pub/Android/ownCloud.git] / src / eu / alefzero / webdav / WebdavClient.java
index 880995d..1416d17 100644 (file)
@@ -22,6 +22,7 @@ import java.io.File;
 import java.io.FileOutputStream;
 import java.io.IOException;
 import java.net.URLDecoder;\r
+import java.net.URLEncoder;\r
 
 import org.apache.commons.httpclient.Credentials;\r
 import org.apache.commons.httpclient.HttpClient;\r
@@ -71,12 +72,13 @@ public class WebdavClient extends HttpClient {
     //HttpGet get = new HttpGet(mUri.toString() + filepath.replace(" ", "%20"));\r
    \r
     Log.e("ASD", mUri.toString() + URLDecoder.decode(filepath) + "");\r
-    GetMethod get = new GetMethod(mUri.toString() + URLDecoder.decode(filepath));\r
+    GetMethod get = new GetMethod(mUri.toString() + URLEncoder.encode(filepath));\r
     
 //    get.setHeader("Host", mUri.getHost());
 //    get.setHeader("User-Agent", "Android-ownCloud");
     
-    try {
+    try {\r
+      Log.e("ASD", get.toString());
       int status = executeMethod(get);
       if (status != HttpStatus.SC_OK) {
         return false;