From 700c9427cdc20a4ef434d8060ab318b7e2655a4f Mon Sep 17 00:00:00 2001 From: Bartek Przybylski Date: Wed, 23 May 2012 19:35:50 +0200 Subject: [PATCH] fix download file with noascii chars in name --- src/eu/alefzero/webdav/WebdavClient.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/eu/alefzero/webdav/WebdavClient.java b/src/eu/alefzero/webdav/WebdavClient.java index 66f27e49..f7cc060e 100644 --- a/src/eu/alefzero/webdav/WebdavClient.java +++ b/src/eu/alefzero/webdav/WebdavClient.java @@ -75,6 +75,12 @@ public class WebdavClient extends HttpClient { public boolean downloadFile(String filepath, File targetPath) { // HttpGet get = new HttpGet(mUri.toString() + filepath.replace(" ", // "%20")); + String[] splitted_filepath = filepath.split("/"); + filepath = ""; + for (String s : splitted_filepath) { + if (s.equals("")) continue; + filepath += "/" + URLEncoder.encode(s); + } Log.e("ASD", mUri.toString() + filepath.replace(" ", "%20") + ""); GetMethod get = new GetMethod(mUri.toString() -- 2.11.0