mirror of
				https://github.com/owncloud/android-library.git
				synced 2025-10-31 02:17:41 +00:00 
			
		
		
		
	Include createFolder as file service operation
This commit is contained in:
		
							parent
							
								
									2b177492d0
								
							
						
					
					
						commit
						ba4592cf37
					
				| @ -30,5 +30,6 @@ import com.owncloud.android.lib.resources.files.RemoteFile | ||||
| interface FileService : Service { | ||||
|     fun checkPathExistence(path: String, isUserLogged: Boolean): RemoteOperationResult<Boolean> | ||||
|     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>> | ||||
| } | ||||
|  | ||||
| @ -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.operations.RemoteOperationResult | ||||
| 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.ReadRemoteFolderOperation | ||||
| import com.owncloud.android.lib.resources.files.RemoteFile | ||||
| import com.owncloud.android.lib.resources.files.services.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( | ||||
|             remotePath = path, | ||||
|             isUserLoggedIn = isUserLogged | ||||
| @ -41,6 +45,17 @@ class OCFileService(override val client: OwnCloudClient) : FileService { | ||||
|     override fun getUrlToOpenInWeb(openWebEndpoint: String, fileId: String): RemoteOperationResult<String> = | ||||
|         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>> = | ||||
|         ReadRemoteFolderOperation( | ||||
|             remotePath = remotePath | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user