fix download file with noascii chars in name
authorBartek Przybylski <bart.p.pl@gmail.com>
Wed, 23 May 2012 17:35:50 +0000 (19:35 +0200)
committerBartek Przybylski <bart.p.pl@gmail.com>
Wed, 23 May 2012 17:35:50 +0000 (19:35 +0200)
src/eu/alefzero/webdav/WebdavClient.java

index 66f27e4..f7cc060 100644 (file)
@@ -75,6 +75,12 @@ public class WebdavClient extends HttpClient {
     public boolean downloadFile(String filepath, File targetPath) {\r
         // HttpGet get = new HttpGet(mUri.toString() + filepath.replace(" ",\r
         // "%20"));\r
     public boolean downloadFile(String filepath, File targetPath) {\r
         // HttpGet get = new HttpGet(mUri.toString() + filepath.replace(" ",\r
         // "%20"));\r
+        String[] splitted_filepath = filepath.split("/");\r
+        filepath = "";\r
+        for (String s : splitted_filepath) {\r
+            if (s.equals("")) continue;\r
+            filepath += "/" + URLEncoder.encode(s);\r
+        }\r
 \r
         Log.e("ASD", mUri.toString() + filepath.replace(" ", "%20") + "");\r
         GetMethod get = new GetMethod(mUri.toString()\r
 \r
         Log.e("ASD", mUri.toString() + filepath.replace(" ", "%20") + "");\r
         GetMethod get = new GetMethod(mUri.toString()\r