mirror of
https://github.com/owncloud/android-library.git
synced 2025-06-09 00:46:15 +00:00
Add rename file to FileService
This commit is contained in:
parent
64f6fdc46d
commit
66556dc527
@ -56,4 +56,11 @@ interface FileService : Service {
|
||||
fun removeFile(
|
||||
remotePath: String
|
||||
): RemoteOperationResult<Unit>
|
||||
|
||||
fun renameFile(
|
||||
oldName: String,
|
||||
oldRemotePath: String,
|
||||
newName: String,
|
||||
isFolder: Boolean,
|
||||
): RemoteOperationResult<Unit>
|
||||
}
|
||||
|
@ -32,6 +32,7 @@ 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
|
||||
import com.owncloud.android.lib.resources.files.RenameRemoteFileOperation
|
||||
import com.owncloud.android.lib.resources.files.services.FileService
|
||||
|
||||
class OCFileService(override val client: OwnCloudClient) : FileService {
|
||||
@ -74,11 +75,30 @@ class OCFileService(override val client: OwnCloudClient) : FileService {
|
||||
targetRemotePath = targetRemotePath,
|
||||
).execute(client)
|
||||
|
||||
override fun refreshFolder(remotePath: String): RemoteOperationResult<ArrayList<RemoteFile>> =
|
||||
override fun refreshFolder(
|
||||
remotePath: String
|
||||
): RemoteOperationResult<ArrayList<RemoteFile>> =
|
||||
ReadRemoteFolderOperation(
|
||||
remotePath = remotePath
|
||||
).execute(client)
|
||||
|
||||
override fun removeFile(remotePath: String): RemoteOperationResult<Unit> =
|
||||
RemoveRemoteFileOperation(remotePath = remotePath).execute(client)
|
||||
override fun removeFile(
|
||||
remotePath: String
|
||||
): RemoteOperationResult<Unit> =
|
||||
RemoveRemoteFileOperation(
|
||||
remotePath = remotePath
|
||||
).execute(client)
|
||||
|
||||
override fun renameFile(
|
||||
oldName: String,
|
||||
oldRemotePath: String,
|
||||
newName: String,
|
||||
isFolder: Boolean
|
||||
): RemoteOperationResult<Unit> =
|
||||
RenameRemoteFileOperation(
|
||||
oldName = oldName,
|
||||
oldRemotePath = oldRemotePath,
|
||||
newName = newName,
|
||||
isFolder = isFolder
|
||||
).execute(client)
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user