X-Git-Url: http://git.linex4red.de/pub/Android/ownCloud.git/blobdiff_plain/900563e245f6f341a3062bd1bae7fca433509ee6..0438f77560641e1c67192ce9edd69c2f719bacde:/src/com/owncloud/android/operations/RemoveFileOperation.java?ds=sidebyside diff --git a/src/com/owncloud/android/operations/RemoveFileOperation.java b/src/com/owncloud/android/operations/RemoveFileOperation.java index aa57356a..69d0a6c3 100644 --- a/src/com/owncloud/android/operations/RemoveFileOperation.java +++ b/src/com/owncloud/android/operations/RemoveFileOperation.java @@ -35,7 +35,7 @@ import eu.alefzero.webdav.WebdavUtils; */ public class RemoveFileOperation extends RemoteOperation { - private static final String TAG = RemoveFileOperation.class.getCanonicalName(); + private static final String TAG = RemoveFileOperation.class.getSimpleName(); private static final int REMOVE_READ_TIMEOUT = 10000; private static final int REMOVE_CONNECTION_TIMEOUT = 5000; @@ -60,7 +60,9 @@ public class RemoveFileOperation extends RemoteOperation { /** - * Performs the removal + * Performs the remove operation + * + * @param client Client object to communicate with the remote ownCloud server. */ @Override protected RemoteOperationResult run(WebdavClient client) { @@ -70,7 +72,11 @@ public class RemoveFileOperation extends RemoteOperation { delete = new DeleteMethod(client.getBaseUri() + WebdavUtils.encodePath(mFileToRemove.getRemotePath())); int status = client.executeMethod(delete, REMOVE_READ_TIMEOUT, REMOVE_CONNECTION_TIMEOUT); if (delete.succeeded()) { - mDataStorageManager.removeFile(mFileToRemove, mDeleteLocalCopy); + if (mFileToRemove.isDirectory()) { + mDataStorageManager.removeDirectory(mFileToRemove, true, mDeleteLocalCopy); + } else { + mDataStorageManager.removeFile(mFileToRemove, mDeleteLocalCopy); + } } delete.getResponseBodyAsString(); // exhaust the response, although not interesting result = new RemoteOperationResult(delete.succeeded(), status);