X-Git-Url: http://git.linex4red.de/pub/Android/ownCloud.git/blobdiff_plain/6e2949f6816e2cb8a33cd2114a1c6cabd5371dfe..0dbb1876fafaa8a1ed8d17d85aec4b29c46d7aab:/src/com/owncloud/android/operations/RenameFileOperation.java diff --git a/src/com/owncloud/android/operations/RenameFileOperation.java b/src/com/owncloud/android/operations/RenameFileOperation.java index 1c636fba..f9bb4242 100644 --- a/src/com/owncloud/android/operations/RenameFileOperation.java +++ b/src/com/owncloud/android/operations/RenameFileOperation.java @@ -26,7 +26,7 @@ import org.apache.jackrabbit.webdav.client.methods.DavMethodBase; import android.accounts.Account; import com.owncloud.android.Log_OC; -import com.owncloud.android.datamodel.DataStorageManager; +import com.owncloud.android.datamodel.FileDataStorageManager; import com.owncloud.android.datamodel.OCFile; import com.owncloud.android.operations.RemoteOperationResult.ResultCode; import com.owncloud.android.utils.FileStorageUtils; @@ -51,7 +51,7 @@ public class RenameFileOperation extends RemoteOperation { private Account mAccount; private String mNewName; private String mNewRemotePath; - private DataStorageManager mStorageManager; + private FileDataStorageManager mStorageManager; /** @@ -62,7 +62,7 @@ public class RenameFileOperation extends RemoteOperation { * @param newName New name to set as the name of file. * @param storageManager Reference to the local database corresponding to the account where the file is contained. */ - public RenameFileOperation(OCFile file, Account account, String newName, DataStorageManager storageManager) { + public RenameFileOperation(OCFile file, Account account, String newName, FileDataStorageManager storageManager) { mFile = file; mAccount = account; mNewName = newName; @@ -94,7 +94,7 @@ public class RenameFileOperation extends RemoteOperation { String parent = (new File(mFile.getRemotePath())).getParent(); parent = (parent.endsWith(OCFile.PATH_SEPARATOR)) ? parent : parent + OCFile.PATH_SEPARATOR; mNewRemotePath = parent + mNewName; - if (mFile.isDirectory()) { + if (mFile.isFolder()) { mNewRemotePath += OCFile.PATH_SEPARATOR; } @@ -113,7 +113,7 @@ public class RenameFileOperation extends RemoteOperation { int status = client.executeMethod(move, RENAME_READ_TIMEOUT, RENAME_CONNECTION_TIMEOUT); if (move.succeeded()) { - if (mFile.isDirectory()) { + if (mFile.isFolder()) { saveLocalDirectory(); } else { @@ -136,7 +136,7 @@ public class RenameFileOperation extends RemoteOperation { } move.getResponseBodyAsString(); // exhaust response, although not interesting - result = new RemoteOperationResult(move.succeeded(), status); + result = new RemoteOperationResult(move.succeeded(), status, move.getResponseHeaders()); Log_OC.i(TAG, "Rename " + mFile.getRemotePath() + " to " + mNewRemotePath + ": " + result.getLogMessage()); } catch (Exception e) { @@ -152,7 +152,7 @@ public class RenameFileOperation extends RemoteOperation { private void saveLocalDirectory() { - mStorageManager.moveDirectory(mFile, mNewRemotePath); + mStorageManager.moveFolder(mFile, mNewRemotePath); String localPath = FileStorageUtils.getDefaultSavePathFor(mAccount.name, mFile); File localDir = new File(localPath); if (localDir.exists()) {