mirror of
https://github.com/owncloud/android-library.git
synced 2025-06-07 16:06:08 +00:00
Add move operation to file service
This commit is contained in:
parent
94eafae901
commit
dbc42c3e4c
@ -46,6 +46,12 @@ interface FileService : Service {
|
||||
localTempPath: String
|
||||
): RemoteOperationResult<Unit>
|
||||
|
||||
fun moveFile(
|
||||
sourceRemotePath: String,
|
||||
targetRemotePath: String,
|
||||
forceOverwrite: Boolean,
|
||||
): RemoteOperationResult<Unit>
|
||||
|
||||
fun refreshFolder(
|
||||
remotePath: String
|
||||
): RemoteOperationResult<ArrayList<RemoteFile>>
|
||||
|
@ -29,6 +29,7 @@ import com.owncloud.android.lib.resources.files.CheckPathExistenceRemoteOperatio
|
||||
import com.owncloud.android.lib.resources.files.CreateRemoteFolderOperation
|
||||
import com.owncloud.android.lib.resources.files.DownloadRemoteFileOperation
|
||||
import com.owncloud.android.lib.resources.files.GetUrlToOpenInWebRemoteOperation
|
||||
import com.owncloud.android.lib.resources.files.MoveRemoteFileOperation
|
||||
import com.owncloud.android.lib.resources.files.ReadRemoteFolderOperation
|
||||
import com.owncloud.android.lib.resources.files.RemoteFile
|
||||
import com.owncloud.android.lib.resources.files.RemoveRemoteFileOperation
|
||||
@ -68,6 +69,17 @@ class OCFileService(override val client: OwnCloudClient) : FileService {
|
||||
localFolderPath = localTempPath
|
||||
).execute(client)
|
||||
|
||||
override fun moveFile(
|
||||
sourceRemotePath: String,
|
||||
targetRemotePath: String,
|
||||
forceOverwrite: Boolean
|
||||
): RemoteOperationResult<Unit> =
|
||||
MoveRemoteFileOperation(
|
||||
sourceRemotePath = sourceRemotePath,
|
||||
targetRemotePath = targetRemotePath,
|
||||
forceOverwrite = forceOverwrite
|
||||
).execute(client)
|
||||
|
||||
override fun refreshFolder(remotePath: String): RemoteOperationResult<ArrayList<RemoteFile>> =
|
||||
ReadRemoteFolderOperation(
|
||||
remotePath = remotePath
|
||||
|
Loading…
x
Reference in New Issue
Block a user