X-Git-Url: http://git.linex4red.de/pub/Android/ownCloud.git/blobdiff_plain/fd1704c49cfabc9607bc67d35b6f36afca0591ff..ec38629eca5cf20c1e05a6e1562011b6d47798b5:/src/eu/alefzero/webdav/WebdavClient.java diff --git a/src/eu/alefzero/webdav/WebdavClient.java b/src/eu/alefzero/webdav/WebdavClient.java index a8d22ce8..907de67c 100644 --- a/src/eu/alefzero/webdav/WebdavClient.java +++ b/src/eu/alefzero/webdav/WebdavClient.java @@ -21,7 +21,6 @@ import java.io.BufferedInputStream; import java.io.File; import java.io.FileOutputStream; import java.io.IOException; -import java.net.URLEncoder; import org.apache.commons.httpclient.Credentials; import org.apache.commons.httpclient.HttpClient; @@ -71,19 +70,23 @@ public class WebdavClient extends HttpClient { new EasySSLSocketFactory(), 443)); } - public boolean downloadFile(String filepath, File targetPath) { + public boolean downloadFile(String remoteFilepath, File targetPath) { // HttpGet get = new HttpGet(mUri.toString() + filepath.replace(" ", // "%20")); - String[] splitted_filepath = filepath.split("/"); - filepath = ""; + /* dvelasco - this is not necessary anymore; OCFile.mRemotePath (the origin of remoteFielPath) keeps valid URL strings + String[] splitted_filepath = remoteFilepath.split("/"); + remoteFilepath = ""; for (String s : splitted_filepath) { if (s.equals("")) continue; - filepath += "/" + URLEncoder.encode(s); + remoteFilepath += "/" + URLEncoder.encode(s); } - Log.e("ASD", mUri.toString() + filepath.replace(" ", "%20") + ""); + Log.e("ASD", mUri.toString() + remoteFilepath.replace(" ", "%20") + ""); GetMethod get = new GetMethod(mUri.toString() - + filepath.replace(" ", "%20")); + + remoteFilepath.replace(" ", "%20")); + */ + + GetMethod get = new GetMethod(mUri.toString() + remoteFilepath); // get.setHeader("Host", mUri.getHost()); // get.setHeader("User-Agent", "Android-ownCloud"); @@ -155,8 +158,7 @@ public class WebdavClient extends HttpClient { public boolean createDirectory(String path) { try { - MkColMethod mkcol = new MkColMethod(mUri.toString() + "/" + path - + "/"); + MkColMethod mkcol = new MkColMethod(mUri.toString() + path); int status = executeMethod(mkcol); Log.d(TAG, "Status returned " + status); Log.d(TAG, "uri: " + mkcol.getURI().toString());