import java.io.File;\r
import java.io.FileOutputStream;\r
import java.io.IOException;\r
-import java.net.URLEncoder;\r
\r
import org.apache.commons.httpclient.Credentials;\r
import org.apache.commons.httpclient.HttpClient;\r
new EasySSLSocketFactory(), 443));\r
}\r
\r
- public boolean downloadFile(String filepath, File targetPath) {\r
+ public boolean downloadFile(String remoteFilepath, File targetPath) {\r
// HttpGet get = new HttpGet(mUri.toString() + filepath.replace(" ",\r
// "%20"));\r
- String[] splitted_filepath = filepath.split("/");\r
- filepath = "";\r
+ /* dvelasco - this is not necessary anymore; OCFile.mRemotePath (the origin of remoteFielPath) keeps valid URL strings\r
+ String[] splitted_filepath = remoteFilepath.split("/");\r
+ remoteFilepath = "";\r
for (String s : splitted_filepath) {\r
if (s.equals("")) continue;\r
- filepath += "/" + URLEncoder.encode(s);\r
+ remoteFilepath += "/" + URLEncoder.encode(s);\r
}\r
\r
- Log.e("ASD", mUri.toString() + filepath.replace(" ", "%20") + "");\r
+ Log.e("ASD", mUri.toString() + remoteFilepath.replace(" ", "%20") + "");\r
GetMethod get = new GetMethod(mUri.toString()\r
- + filepath.replace(" ", "%20"));\r
+ + remoteFilepath.replace(" ", "%20"));\r
+ */\r
+ \r
+ GetMethod get = new GetMethod(mUri.toString() + remoteFilepath);\r
\r
// get.setHeader("Host", mUri.getHost());\r
// get.setHeader("User-Agent", "Android-ownCloud");\r
\r
public boolean createDirectory(String path) {\r
try {\r
- MkColMethod mkcol = new MkColMethod(mUri.toString() + "/" + path\r
- + "/");\r
+ MkColMethod mkcol = new MkColMethod(mUri.toString() + path);\r
int status = executeMethod(mkcol);\r
Log.d(TAG, "Status returned " + status);\r
Log.d(TAG, "uri: " + mkcol.getURI().toString());\r