projects
/
pub
/
Android
/
ownCloud.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
c6b553f
)
Fixed problem with some special characters when opening files; renamed WebdavUtils...
author
David A. Velasco
<dvelasco@solidgear.es>
Tue, 17 Jul 2012 12:26:18 +0000
(14:26 +0200)
committer
David A. Velasco
<dvelasco@solidgear.es>
Tue, 17 Jul 2012 12:26:18 +0000
(14:26 +0200)
AndroidManifest.xml
patch
|
blob
|
blame
|
history
src/eu/alefzero/owncloud/syncadapter/FileSyncAdapter.java
patch
|
blob
|
blame
|
history
src/eu/alefzero/owncloud/ui/adapter/FileListActionListAdapter.java
patch
|
blob
|
blame
|
history
src/eu/alefzero/owncloud/ui/fragment/FileDetailFragment.java
patch
|
blob
|
blame
|
history
src/eu/alefzero/webdav/WebdavClient.java
patch
|
blob
|
blame
|
history
src/eu/alefzero/webdav/WebdavUtils.java
patch
|
blob
|
blame
|
history
diff --git
a/AndroidManifest.xml
b/AndroidManifest.xml
index
a547234
..
362a601
100644
(file)
--- a/
AndroidManifest.xml
+++ b/
AndroidManifest.xml
@@
-18,7
+18,7
@@
-->
\r
<manifest package="eu.alefzero.owncloud"
\r
android:versionCode="1"
\r
-->
\r
<manifest package="eu.alefzero.owncloud"
\r
android:versionCode="1"
\r
- android:versionName="0.1.16
1
B" xmlns:android="http://schemas.android.com/apk/res/android">
\r
+ android:versionName="0.1.16
2
B" 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
\r
<uses-permission android:name="android.permission.GET_ACCOUNTS" />
\r
<uses-permission android:name="android.permission.USE_CREDENTIALS" />
\r
diff --git
a/src/eu/alefzero/owncloud/syncadapter/FileSyncAdapter.java
b/src/eu/alefzero/owncloud/syncadapter/FileSyncAdapter.java
index
61975dd
..
9dfa8f6
100644
(file)
--- a/
src/eu/alefzero/owncloud/syncadapter/FileSyncAdapter.java
+++ b/
src/eu/alefzero/owncloud/syncadapter/FileSyncAdapter.java
@@
-220,7
+220,7
@@
public class FileSyncAdapter extends AbstractOwnCloudSyncAdapter {
for (int i=0; i < files.size() && !mCancellation; i++) {
\r
OCFile newFile = files.get(i);
\r
if (newFile.getMimetype().equals("DIR")) {
\r
for (int i=0; i < files.size() && !mCancellation; i++) {
\r
OCFile newFile = files.get(i);
\r
if (newFile.getMimetype().equals("DIR")) {
\r
- fetchData(getUri().toString() + WebdavUtils.encode(newFile.getRemotePath()), syncResult, newFile.getFileId());
\r
+ fetchData(getUri().toString() + WebdavUtils.encode
Path
(newFile.getRemotePath()), syncResult, newFile.getFileId());
\r
}
\r
}
\r
if (mCancellation) Log.d(TAG, "Leaving " + uri + " because cancellation request");
\r
}
\r
}
\r
if (mCancellation) Log.d(TAG, "Leaving " + uri + " because cancellation request");
\r
diff --git
a/src/eu/alefzero/owncloud/ui/adapter/FileListActionListAdapter.java
b/src/eu/alefzero/owncloud/ui/adapter/FileListActionListAdapter.java
index
d0d5b5f
..
1556e0d
100644
(file)
--- a/
src/eu/alefzero/owncloud/ui/adapter/FileListActionListAdapter.java
+++ b/
src/eu/alefzero/owncloud/ui/adapter/FileListActionListAdapter.java
@@
-23,6
+23,7
@@
import java.io.File;
import eu.alefzero.owncloud.R;
import eu.alefzero.owncloud.authenticator.AccountAuthenticator;
import eu.alefzero.owncloud.db.ProviderMeta.ProviderTableMeta;
import eu.alefzero.owncloud.R;
import eu.alefzero.owncloud.authenticator.AccountAuthenticator;
import eu.alefzero.owncloud.db.ProviderMeta.ProviderTableMeta;
+import eu.alefzero.webdav.WebdavUtils;
import android.accounts.Account;
import android.accounts.AccountManager;
import android.content.Context;
import android.accounts.Account;
import android.accounts.AccountManager;
import android.content.Context;
@@
-84,7
+85,7
@@
public class FileListActionListAdapter implements ListAdapter {
.getSystemService(Context.ACCOUNT_SERVICE);
String ocurl = accm.getUserData(mAccount,
AccountAuthenticator.KEY_OC_URL);
.getSystemService(Context.ACCOUNT_SERVICE);
String ocurl = accm.getUserData(mAccount,
AccountAuthenticator.KEY_OC_URL);
- ocurl +=
mFilePath + Uri.encode(
mFilename);
+ ocurl +=
WebdavUtils.encodePath(mFilePath +
mFilename);
intent.setData(Uri.parse(ocurl));
} else {
intent.putExtra("toDownload", false);
intent.setData(Uri.parse(ocurl));
} else {
intent.putExtra("toDownload", false);
diff --git
a/src/eu/alefzero/owncloud/ui/fragment/FileDetailFragment.java
b/src/eu/alefzero/owncloud/ui/fragment/FileDetailFragment.java
index
7eb0c1b
..
63d11bf
100644
(file)
--- a/
src/eu/alefzero/owncloud/ui/fragment/FileDetailFragment.java
+++ b/
src/eu/alefzero/owncloud/ui/fragment/FileDetailFragment.java
@@
-197,6
+197,7
@@
public class FileDetailFragment extends SherlockFragment implements
IntentFilter filter = new IntentFilter(
\r
FileDownloader.DOWNLOAD_FINISH_MESSAGE);
\r
getActivity().registerReceiver(mDownloadFinishReceiver, filter);
\r
IntentFilter filter = new IntentFilter(
\r
FileDownloader.DOWNLOAD_FINISH_MESSAGE);
\r
getActivity().registerReceiver(mDownloadFinishReceiver, filter);
\r
+ mPreview = (ImageView)mView.findViewById(R.id.fdPreview);
\r
}
\r
\r
@Override
\r
}
\r
\r
@Override
\r
@@
-340,9
+341,10
@@
public class FileDetailFragment extends SherlockFragment implements
@Override
\r
public void onClick(View v) {
\r
String storagePath = mFile.getStoragePath();
\r
@Override
\r
public void onClick(View v) {
\r
String storagePath = mFile.getStoragePath();
\r
+ String encodedStoragePath = WebdavUtils.encodePath(storagePath);
\r
try {
\r
Intent i = new Intent(Intent.ACTION_VIEW);
\r
try {
\r
Intent i = new Intent(Intent.ACTION_VIEW);
\r
- i.setDataAndType(Uri.parse("file://"+
s
toragePath), mFile.getMimetype());
\r
+ i.setDataAndType(Uri.parse("file://"+
encodedS
toragePath), mFile.getMimetype());
\r
i.setFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION | Intent.FLAG_GRANT_WRITE_URI_PERMISSION);
\r
startActivity(i);
\r
\r
i.setFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION | Intent.FLAG_GRANT_WRITE_URI_PERMISSION);
\r
startActivity(i);
\r
\r
@@
-354,7
+356,7
@@
public class FileDetailFragment extends SherlockFragment implements
Intent i = new Intent(Intent.ACTION_VIEW);
\r
mimeType = MimeTypeMap.getSingleton().getMimeTypeFromExtension(storagePath.substring(storagePath.lastIndexOf('.') + 1));
\r
if (mimeType != null && !mimeType.equals(mFile.getMimetype())) {
\r
Intent i = new Intent(Intent.ACTION_VIEW);
\r
mimeType = MimeTypeMap.getSingleton().getMimeTypeFromExtension(storagePath.substring(storagePath.lastIndexOf('.') + 1));
\r
if (mimeType != null && !mimeType.equals(mFile.getMimetype())) {
\r
- i.setDataAndType(Uri.parse("file://"+
mFile.getStoragePath()
), mimeType);
\r
+ i.setDataAndType(Uri.parse("file://"+
encodedStoragePath
), mimeType);
\r
i.setFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION | Intent.FLAG_GRANT_WRITE_URI_PERMISSION);
\r
startActivity(i);
\r
toastIt = false;
\r
i.setFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION | Intent.FLAG_GRANT_WRITE_URI_PERMISSION);
\r
startActivity(i);
\r
toastIt = false;
\r
@@
-644,11
+646,11
@@
public class FileDetailFragment extends SherlockFragment implements
String baseUrl = am.getUserData(mAccount, AccountAuthenticator.KEY_OC_BASE_URL);
\r
OwnCloudVersion ocv = new OwnCloudVersion(am.getUserData(mAccount, AccountAuthenticator.KEY_OC_VERSION));
\r
String webdav_path = AccountUtils.getWebdavPath(ocv);
\r
String baseUrl = am.getUserData(mAccount, AccountAuthenticator.KEY_OC_BASE_URL);
\r
OwnCloudVersion ocv = new OwnCloudVersion(am.getUserData(mAccount, AccountAuthenticator.KEY_OC_VERSION));
\r
String webdav_path = AccountUtils.getWebdavPath(ocv);
\r
- Log.d("ASD", ""+baseUrl + webdav_path + WebdavUtils.encode(mOld.getRemotePath()));
\r
+ Log.d("ASD", ""+baseUrl + webdav_path + WebdavUtils.encode
Path
(mOld.getRemotePath()));
\r
\r
\r
- Log.e("ASD", Uri.parse(baseUrl).getPath() == null ? "" : Uri.parse(baseUrl).getPath() + webdav_path + WebdavUtils.encode(mNew.getRemotePath()));
\r
- LocalMoveMethod move = new LocalMoveMethod(baseUrl + webdav_path + WebdavUtils.encode(mOld.getRemotePath()),
\r
- Uri.parse(baseUrl).getPath() == null ? "" : Uri.parse(baseUrl).getPath() + webdav_path + WebdavUtils.encode(mNew.getRemotePath()));
\r
+ Log.e("ASD", Uri.parse(baseUrl).getPath() == null ? "" : Uri.parse(baseUrl).getPath() + webdav_path + WebdavUtils.encode
Path
(mNew.getRemotePath()));
\r
+ LocalMoveMethod move = new LocalMoveMethod(baseUrl + webdav_path + WebdavUtils.encode
Path
(mOld.getRemotePath()),
\r
+ Uri.parse(baseUrl).getPath() == null ? "" : Uri.parse(baseUrl).getPath() + webdav_path + WebdavUtils.encode
Path
(mNew.getRemotePath()));
\r
\r
try {
\r
int status = wc.executeMethod(move);
\r
\r
try {
\r
int status = wc.executeMethod(move);
\r
@@
-772,9
+774,9
@@
public class FileDetailFragment extends SherlockFragment implements
String baseUrl = am.getUserData(mAccount, AccountAuthenticator.KEY_OC_BASE_URL);
\r
OwnCloudVersion ocv = new OwnCloudVersion(am.getUserData(mAccount, AccountAuthenticator.KEY_OC_VERSION));
\r
String webdav_path = AccountUtils.getWebdavPath(ocv);
\r
String baseUrl = am.getUserData(mAccount, AccountAuthenticator.KEY_OC_BASE_URL);
\r
OwnCloudVersion ocv = new OwnCloudVersion(am.getUserData(mAccount, AccountAuthenticator.KEY_OC_VERSION));
\r
String webdav_path = AccountUtils.getWebdavPath(ocv);
\r
- Log.d("ASD", ""+baseUrl + webdav_path + WebdavUtils.encode(mFileToRemove.getRemotePath()));
\r
+ Log.d("ASD", ""+baseUrl + webdav_path + WebdavUtils.encode
Path
(mFileToRemove.getRemotePath()));
\r
\r
\r
- DeleteMethod delete = new DeleteMethod(baseUrl + webdav_path + WebdavUtils.encode(mFileToRemove.getRemotePath()));
\r
+ DeleteMethod delete = new DeleteMethod(baseUrl + webdav_path + WebdavUtils.encode
Path
(mFileToRemove.getRemotePath()));
\r
HttpMethodParams params = delete.getParams();
\r
params.setSoTimeout(1000);
\r
delete.setParams(params);
\r
HttpMethodParams params = delete.getParams();
\r
params.setSoTimeout(1000);
\r
delete.setParams(params);
\r
diff --git
a/src/eu/alefzero/webdav/WebdavClient.java
b/src/eu/alefzero/webdav/WebdavClient.java
index
9eafddc
..
e248eb8
100644
(file)
--- a/
src/eu/alefzero/webdav/WebdavClient.java
+++ b/
src/eu/alefzero/webdav/WebdavClient.java
@@
-122,7
+122,7
@@
public class WebdavClient extends HttpClient {
*/
\r
public boolean downloadFile(String remoteFilepath, File targetPath) {
\r
boolean ret = false;
\r
*/
\r
public boolean downloadFile(String remoteFilepath, File targetPath) {
\r
boolean ret = false;
\r
- GetMethod get = new GetMethod(mUri.toString() + WebdavUtils.encode(remoteFilepath));
\r
+ GetMethod get = new GetMethod(mUri.toString() + WebdavUtils.encode
Path
(remoteFilepath));
\r
HttpMethodParams params = get.getParams();
\r
params.setSoTimeout(0); // that means "infinite timeout"; it's the default value, but let's make it explicit
\r
get.setParams(params);
\r
HttpMethodParams params = get.getParams();
\r
params.setSoTimeout(0); // that means "infinite timeout"; it's the default value, but let's make it explicit
\r
get.setParams(params);
\r
@@
-163,7
+163,7
@@
public class WebdavClient extends HttpClient {
* @return
\r
*/
\r
public boolean deleteFile(String remoteFilePath){
\r
* @return
\r
*/
\r
public boolean deleteFile(String remoteFilePath){
\r
- DavMethod delete = new DeleteMethod(mUri.toString() + WebdavUtils.encode(remoteFilePath));
\r
+ DavMethod delete = new DeleteMethod(mUri.toString() + WebdavUtils.encode
Path
(remoteFilePath));
\r
try {
\r
executeMethod(delete);
\r
} catch (Throwable e) {
\r
try {
\r
executeMethod(delete);
\r
} catch (Throwable e) {
\r
@@
-196,7
+196,7
@@
public class WebdavClient extends HttpClient {
FileRequestEntity entity = new FileRequestEntity(f, contentType);
\r
entity.setOnDatatransferProgressListener(mDataTransferListener);
\r
Log.e("ASD", f.exists() + " " + entity.getContentLength());
\r
FileRequestEntity entity = new FileRequestEntity(f, contentType);
\r
entity.setOnDatatransferProgressListener(mDataTransferListener);
\r
Log.e("ASD", f.exists() + " " + entity.getContentLength());
\r
- PutMethod put = new PutMethod(mUri.toString() + WebdavUtils.encode(remoteTarget));
\r
+ PutMethod put = new PutMethod(mUri.toString() + WebdavUtils.encode
Path
(remoteTarget));
\r
HttpMethodParams params = put.getParams();
\r
params.setSoTimeout(0); // that means "infinite timeout"; it's the default value, but let's make it explicit
\r
put.setParams(params);
\r
HttpMethodParams params = put.getParams();
\r
params.setSoTimeout(0); // that means "infinite timeout"; it's the default value, but let's make it explicit
\r
put.setParams(params);
\r
@@
-242,7
+242,7
@@
public class WebdavClient extends HttpClient {
*/
\r
public boolean createDirectory(String path) {
\r
try {
\r
*/
\r
public boolean createDirectory(String path) {
\r
try {
\r
- MkColMethod mkcol = new MkColMethod(mUri.toString() + WebdavUtils.encode(path));
\r
+ MkColMethod mkcol = new MkColMethod(mUri.toString() + WebdavUtils.encode
Path
(path));
\r
int status = executeMethod(mkcol);
\r
Log.d(TAG, "Status returned " + status);
\r
Log.d(TAG, "uri: " + mkcol.getURI().toString());
\r
int status = executeMethod(mkcol);
\r
Log.d(TAG, "Status returned " + status);
\r
Log.d(TAG, "uri: " + mkcol.getURI().toString());
\r
diff --git
a/src/eu/alefzero/webdav/WebdavUtils.java
b/src/eu/alefzero/webdav/WebdavUtils.java
index
8e7c07b
..
b6c0f2e
100644
(file)
--- a/
src/eu/alefzero/webdav/WebdavUtils.java
+++ b/
src/eu/alefzero/webdav/WebdavUtils.java
@@
-68,7
+68,7
@@
public class WebdavUtils {
* @param remoteFilePath Path
* @return Encoded path according to RFC 2396, always starting with "/"
*/
* @param remoteFilePath Path
* @return Encoded path according to RFC 2396, always starting with "/"
*/
- public static String encode(String remoteFilePath) {
+ public static String encode
Path
(String remoteFilePath) {
String encodedPath = Uri.encode(remoteFilePath, "/");
if (!encodedPath.startsWith("/"))
encodedPath = "/" + encodedPath;
String encodedPath = Uri.encode(remoteFilePath, "/");
if (!encodedPath.startsWith("/"))
encodedPath = "/" + encodedPath;