-->\r
<manifest package="eu.alefzero.owncloud"\r
android:versionCode="1"\r
- android:versionName="0.1.133B" xmlns:android="http://schemas.android.com/apk/res/android">\r
+ android:versionName="0.1.134B" xmlns:android="http://schemas.android.com/apk/res/android">\r
\r
<uses-permission android:name="android.permission.GET_ACCOUNTS" />\r
<uses-permission android:name="android.permission.USE_CREDENTIALS" />\r
public OCFile(String path) {
resetData();
mNeedsUpdating = false;
- // dvelasco: let's make mandatory that mRemotePath is a valid URL always; this will make our life easier with the URL-encoding/decoding
+ /// dvelasco: the encoding / decoding problem should be completely translated to WebdavClient & WebdavEntry, but at this moment we are in a little hurry
if (path != null && path.length() > 0) {
try {
new URL("http://silly.test.com:8888" + path);
throw new RuntimeException("Trying to create a OCFile with a non valid remote path: " + path , e);
}
} else throw new RuntimeException("Trying to create a OCFile with a non valid remote path: " + path);
- mRemotePath = path;
+ // save encoded paths have a problem: normalization; this is a quick&dirty fix to avoid duplications
+ mRemotePath = Uri.encode(Uri.decode(path), "/");
}
/**
try {
status = wdc.executeMethod(mkcol);
Log.e(TAG, "mkcol returned " + status);
- wdc.putFile(filepath, INSTANT_UPLOAD_DIR + "/" + filename, mimetype);
+ wdc.putFile(filepath, INSTANT_UPLOAD_DIR + "/" + Uri.encode(filename), mimetype);
} catch (HttpException e) {
e.printStackTrace();
} catch (IOException e) {
\r
// TODO: fix hack: workaround for bug in actionbar sherlock\r
// it always shows indeterminate progress bar\r
- if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.ICE_CREAM_SANDWICH) {\r
+ if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.HONEYCOMB) {\r
requestWindowFeature(Window.FEATURE_INDETERMINATE_PROGRESS);\r
setProgressBarIndeterminateVisibility(false);\r
}\r
// Figure out the path where the dir needs to be created\r
String path;\r
if (mCurrentDir == null) {\r
+ // this is just a patch; we should ensure that mCurrentDir never is null\r
if (!mStorageManager.fileExists("/")) {\r
OCFile file = new OCFile("/");\r
mStorageManager.saveFile(file);\r
- mCurrentDir = mStorageManager.getFileByPath("/");\r
- } else {\r
- Log.wtf("FileDisplay", "OMG NO!");\r
- return;\r
}\r
+ mCurrentDir = mStorageManager.getFileByPath("/");\r
}\r
path = FileDisplayActivity.this.mCurrentDir.getRemotePath();\r
\r
GetMethod get = new GetMethod(mUri.toString()\r
+ remoteFilepath.replace(" ", "%20"));\r
*/\r
- \r
GetMethod get = new GetMethod(mUri.toString() + remoteFilepath);\r
\r
// get.setHeader("Host", mUri.getHost());\r