X-Git-Url: http://git.linex4red.de/pub/Android/ownCloud.git/blobdiff_plain/5af0fb44b4c859f9f7f7aca39376686f091b496e..d0b7df16e7db7aacfeab0685eb9ceaf6b58fbc08:/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 897ce7af..d8809a69 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,6 +60,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. @@ -72,7 +82,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);