Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit b8a3eb05 authored by masensio's avatar masensio
Browse files

Remove exhaust response in RenameRemoteFileOperation

parent 16c91473
Loading
Loading
Loading
Loading
+37 −35
Original line number Diff line number Diff line
@@ -106,14 +106,16 @@ public class RenameRemoteFileOperation extends RemoteOperation {
                move = new LocalMoveMethod( client.getWebdavUri() +
                        WebdavUtils.encodePath(mOldRemotePath),
                        client.getWebdavUri() + WebdavUtils.encodePath(mNewRemotePath));
            int status = client.executeMethod(move, RENAME_READ_TIMEOUT, RENAME_CONNECTION_TIMEOUT);
                int status = client.executeMethod(move, RENAME_READ_TIMEOUT,
                        RENAME_CONNECTION_TIMEOUT);

                if (status == 400) {
                    result = new RemoteOperationResult(move.succeeded(),
                            move.getResponseBodyAsString(), status);
                    Log_OC.d(TAG, move.getResponseBodyAsString());
                } else {
                move.getResponseBodyAsString(); // exhaust response, although not interesting
                    client.exhaustResponse(move.getResponseBodyAsStream());//exhaust response,
                                                                         // although not interesting
                    result = new RemoteOperationResult(move.succeeded(), status,
                            move.getResponseHeaders());
                    Log_OC.i(TAG, "Rename " + mOldRemotePath + " to " + mNewRemotePath + ": " +