From b3cccfa007ccf00b32c10cac9adb1c73528fd089 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Abel=20Garci=CC=81a=20de=20Prada?= Date: Tue, 11 May 2021 17:34:34 +0200 Subject: [PATCH] Add move operation to chunk service --- .../lib/resources/files/services/ChunkService.kt | 8 ++++++++ .../services/implementation/OCChunkService.kt | 16 ++++++++++++++++ 2 files changed, 24 insertions(+) diff --git a/owncloudComLibrary/src/main/java/com/owncloud/android/lib/resources/files/services/ChunkService.kt b/owncloudComLibrary/src/main/java/com/owncloud/android/lib/resources/files/services/ChunkService.kt index 011dbe35..895b3c14 100644 --- a/owncloudComLibrary/src/main/java/com/owncloud/android/lib/resources/files/services/ChunkService.kt +++ b/owncloudComLibrary/src/main/java/com/owncloud/android/lib/resources/files/services/ChunkService.kt @@ -31,4 +31,12 @@ interface ChunkService : Service { fun removeFile( remotePath: String ): RemoteOperationResult + + fun moveFile( + sourceRemotePath: String, + targetRemotePath: String, + overwrite: Boolean, + fileLastModificationTimestamp: String, + fileLength: Long + ): RemoteOperationResult } diff --git a/owncloudComLibrary/src/main/java/com/owncloud/android/lib/resources/files/services/implementation/OCChunkService.kt b/owncloudComLibrary/src/main/java/com/owncloud/android/lib/resources/files/services/implementation/OCChunkService.kt index d7ca75e8..78068410 100644 --- a/owncloudComLibrary/src/main/java/com/owncloud/android/lib/resources/files/services/implementation/OCChunkService.kt +++ b/owncloudComLibrary/src/main/java/com/owncloud/android/lib/resources/files/services/implementation/OCChunkService.kt @@ -26,6 +26,7 @@ package com.owncloud.android.lib.resources.files.services.implementation import com.owncloud.android.lib.common.OwnCloudClient import com.owncloud.android.lib.common.operations.RemoteOperationResult +import com.owncloud.android.lib.resources.files.chunks.MoveRemoteChunksFileOperation import com.owncloud.android.lib.resources.files.chunks.RemoveRemoteChunksFolderOperation import com.owncloud.android.lib.resources.files.services.ChunkService @@ -33,4 +34,19 @@ class OCChunkService(override val client: OwnCloudClient) : ChunkService { override fun removeFile(remotePath: String): RemoteOperationResult = RemoveRemoteChunksFolderOperation(remotePath = remotePath).execute(client) + + override fun moveFile( + sourceRemotePath: String, + targetRemotePath: String, + overwrite: Boolean, + fileLastModificationTimestamp: String, + fileLength: Long + ): RemoteOperationResult = + MoveRemoteChunksFileOperation( + sourceRemotePath = sourceRemotePath, + targetRemotePath = targetRemotePath, + overwrite = overwrite, + fileLastModificationTimestamp = fileLastModificationTimestamp, + fileLength = fileLength + ).execute(client) }