mirror of
https://github.com/owncloud/android-library.git
synced 2025-06-07 16:06:08 +00:00
Include createFolder as file service operation
This commit is contained in:
parent
b0798194be
commit
cd94e39b7f
@ -30,5 +30,6 @@ import com.owncloud.android.lib.resources.files.RemoteFile
|
|||||||
interface FileService : Service {
|
interface FileService : Service {
|
||||||
fun checkPathExistence(path: String, isUserLogged: Boolean): RemoteOperationResult<Boolean>
|
fun checkPathExistence(path: String, isUserLogged: Boolean): RemoteOperationResult<Boolean>
|
||||||
fun getUrlToOpenInWeb(openWebEndpoint: String, fileId: String): RemoteOperationResult<String>
|
fun getUrlToOpenInWeb(openWebEndpoint: String, fileId: String): RemoteOperationResult<String>
|
||||||
|
fun createFolder(remotePath: String, createFullPath: Boolean, isChunkFolder: Boolean = false): RemoteOperationResult<Unit>
|
||||||
fun refreshFolder(remotePath: String): RemoteOperationResult<ArrayList<RemoteFile>>
|
fun refreshFolder(remotePath: String): RemoteOperationResult<ArrayList<RemoteFile>>
|
||||||
}
|
}
|
||||||
|
@ -26,13 +26,17 @@ package com.owncloud.android.lib.resources.files.services.implementation
|
|||||||
import com.owncloud.android.lib.common.OwnCloudClient
|
import com.owncloud.android.lib.common.OwnCloudClient
|
||||||
import com.owncloud.android.lib.common.operations.RemoteOperationResult
|
import com.owncloud.android.lib.common.operations.RemoteOperationResult
|
||||||
import com.owncloud.android.lib.resources.files.CheckPathExistenceRemoteOperation
|
import com.owncloud.android.lib.resources.files.CheckPathExistenceRemoteOperation
|
||||||
|
import com.owncloud.android.lib.resources.files.CreateRemoteFolderOperation
|
||||||
import com.owncloud.android.lib.resources.files.GetUrlToOpenInWebRemoteOperation
|
import com.owncloud.android.lib.resources.files.GetUrlToOpenInWebRemoteOperation
|
||||||
import com.owncloud.android.lib.resources.files.ReadRemoteFolderOperation
|
import com.owncloud.android.lib.resources.files.ReadRemoteFolderOperation
|
||||||
import com.owncloud.android.lib.resources.files.RemoteFile
|
import com.owncloud.android.lib.resources.files.RemoteFile
|
||||||
import com.owncloud.android.lib.resources.files.services.FileService
|
import com.owncloud.android.lib.resources.files.services.FileService
|
||||||
|
|
||||||
class OCFileService(override val client: OwnCloudClient) : FileService {
|
class OCFileService(override val client: OwnCloudClient) : FileService {
|
||||||
override fun checkPathExistence(path: String, isUserLogged: Boolean): RemoteOperationResult<Boolean> =
|
override fun checkPathExistence(
|
||||||
|
path: String,
|
||||||
|
isUserLogged: Boolean
|
||||||
|
): RemoteOperationResult<Boolean> =
|
||||||
CheckPathExistenceRemoteOperation(
|
CheckPathExistenceRemoteOperation(
|
||||||
remotePath = path,
|
remotePath = path,
|
||||||
isUserLoggedIn = isUserLogged
|
isUserLoggedIn = isUserLogged
|
||||||
@ -41,6 +45,17 @@ class OCFileService(override val client: OwnCloudClient) : FileService {
|
|||||||
override fun getUrlToOpenInWeb(openWebEndpoint: String, fileId: String): RemoteOperationResult<String> =
|
override fun getUrlToOpenInWeb(openWebEndpoint: String, fileId: String): RemoteOperationResult<String> =
|
||||||
GetUrlToOpenInWebRemoteOperation(openWithWebEndpoint = openWebEndpoint, fileId = fileId).execute(client)
|
GetUrlToOpenInWebRemoteOperation(openWithWebEndpoint = openWebEndpoint, fileId = fileId).execute(client)
|
||||||
|
|
||||||
|
override fun createFolder(
|
||||||
|
remotePath: String,
|
||||||
|
createFullPath: Boolean,
|
||||||
|
isChunkFolder: Boolean
|
||||||
|
): RemoteOperationResult<Unit> =
|
||||||
|
CreateRemoteFolderOperation(
|
||||||
|
remotePath = remotePath,
|
||||||
|
createFullPath = createFullPath,
|
||||||
|
isChunksFolder = isChunkFolder
|
||||||
|
).execute(client)
|
||||||
|
|
||||||
override fun refreshFolder(remotePath: String): RemoteOperationResult<ArrayList<RemoteFile>> =
|
override fun refreshFolder(remotePath: String): RemoteOperationResult<ArrayList<RemoteFile>> =
|
||||||
ReadRemoteFolderOperation(
|
ReadRemoteFolderOperation(
|
||||||
remotePath = remotePath
|
remotePath = remotePath
|
||||||
|
Loading…
x
Reference in New Issue
Block a user