projects
/
pub
/
Android
/
ownCloud.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Added scroll to generic explanation activity. Enabled the copy of past uploads into...
[pub/Android/ownCloud.git]
/
src
/
com
/
owncloud
/
android
/
operations
/
RemoveFileOperation.java
diff --git
a/src/com/owncloud/android/operations/RemoveFileOperation.java
b/src/com/owncloud/android/operations/RemoveFileOperation.java
index
69d0a6c
..
bfc063f
100644
(file)
--- a/
src/com/owncloud/android/operations/RemoveFileOperation.java
+++ b/
src/com/owncloud/android/operations/RemoveFileOperation.java
@@
-18,6
+18,7
@@
package com.owncloud.android.operations;
package com.owncloud.android.operations;
+import org.apache.commons.httpclient.HttpStatus;
import org.apache.jackrabbit.webdav.client.methods.DeleteMethod;
import android.util.Log;
import org.apache.jackrabbit.webdav.client.methods.DeleteMethod;
import android.util.Log;
@@
-60,6
+61,16
@@
public class RemoveFileOperation extends RemoteOperation {
/**
/**
+ * Getter for the file to remove (or removed, if the operation was successfully performed).
+ *
+ * @return File to remove or already removed.
+ */
+ public OCFile getFile() {
+ return mFileToRemove;
+ }
+
+
+ /**
* Performs the remove operation
*
* @param client Client object to communicate with the remote ownCloud server.
* Performs the remove operation
*
* @param client Client object to communicate with the remote ownCloud server.
@@
-71,7
+82,7
@@
public class RemoveFileOperation extends RemoteOperation {
try {
delete = new DeleteMethod(client.getBaseUri() + WebdavUtils.encodePath(mFileToRemove.getRemotePath()));
int status = client.executeMethod(delete, REMOVE_READ_TIMEOUT, REMOVE_CONNECTION_TIMEOUT);
try {
delete = new DeleteMethod(client.getBaseUri() + WebdavUtils.encodePath(mFileToRemove.getRemotePath()));
int status = client.executeMethod(delete, REMOVE_READ_TIMEOUT, REMOVE_CONNECTION_TIMEOUT);
- if (delete.succeeded()) {
+ if (delete.succeeded()
|| status == HttpStatus.SC_NOT_FOUND
) {
if (mFileToRemove.isDirectory()) {
mDataStorageManager.removeDirectory(mFileToRemove, true, mDeleteLocalCopy);
} else {
if (mFileToRemove.isDirectory()) {
mDataStorageManager.removeDirectory(mFileToRemove, true, mDeleteLocalCopy);
} else {
@@
-79,7
+90,7
@@
public class RemoveFileOperation extends RemoteOperation {
}
}
delete.getResponseBodyAsString(); // exhaust the response, although not interesting
}
}
delete.getResponseBodyAsString(); // exhaust the response, although not interesting
- result = new RemoteOperationResult(
delete.succeeded(
), status);
+ result = new RemoteOperationResult(
(delete.succeeded() || status == HttpStatus.SC_NOT_FOUND
), status);
Log.i(TAG, "Remove " + mFileToRemove.getRemotePath() + ": " + result.getLogMessage());
} catch (Exception e) {
Log.i(TAG, "Remove " + mFileToRemove.getRemotePath() + ": " + result.getLogMessage());
} catch (Exception e) {