mirror of
				https://github.com/owncloud/android-library.git
				synced 2025-10-30 18:07:38 +00:00 
			
		
		
		
	Add move operation to chunk service
This commit is contained in:
		
							parent
							
								
									8ea70d77fa
								
							
						
					
					
						commit
						94eafae901
					
				| @ -31,4 +31,12 @@ interface ChunkService : Service { | ||||
|     fun removeFile( | ||||
|         remotePath: String | ||||
|     ): RemoteOperationResult<Unit> | ||||
| 
 | ||||
|     fun moveFile( | ||||
|         sourceRemotePath: String, | ||||
|         targetRemotePath: String, | ||||
|         overwrite: Boolean, | ||||
|         fileLastModificationTimestamp: String, | ||||
|         fileLength: Long | ||||
|     ): RemoteOperationResult<Unit> | ||||
| } | ||||
|  | ||||
| @ -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<Unit> = | ||||
|         RemoveRemoteChunksFolderOperation(remotePath = remotePath).execute(client) | ||||
| 
 | ||||
|     override fun moveFile( | ||||
|         sourceRemotePath: String, | ||||
|         targetRemotePath: String, | ||||
|         overwrite: Boolean, | ||||
|         fileLastModificationTimestamp: String, | ||||
|         fileLength: Long | ||||
|     ): RemoteOperationResult<Unit> = | ||||
|         MoveRemoteChunksFileOperation( | ||||
|             sourceRemotePath = sourceRemotePath, | ||||
|             targetRemotePath = targetRemotePath, | ||||
|             overwrite = overwrite, | ||||
|             fileLastModificationTimestamp = fileLastModificationTimestamp, | ||||
|             fileLength = fileLength | ||||
|         ).execute(client) | ||||
| } | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user