mirror of
				https://github.com/owncloud/android-library.git
				synced 2025-11-04 12:28:25 +00:00 
			
		
		
		
	Add rename file to FileService
This commit is contained in:
		
							parent
							
								
									39433ea0e1
								
							
						
					
					
						commit
						bfa327d51d
					
				@ -58,4 +58,11 @@ interface FileService : Service {
 | 
				
			|||||||
    fun removeFile(
 | 
					    fun removeFile(
 | 
				
			||||||
        remotePath: String
 | 
					        remotePath: String
 | 
				
			||||||
    ): RemoteOperationResult<Unit>
 | 
					    ): RemoteOperationResult<Unit>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    fun renameFile(
 | 
				
			||||||
 | 
					        oldName: String,
 | 
				
			||||||
 | 
					        oldRemotePath: String,
 | 
				
			||||||
 | 
					        newName: String,
 | 
				
			||||||
 | 
					        isFolder: Boolean,
 | 
				
			||||||
 | 
					    ): RemoteOperationResult<Unit>
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
				
			|||||||
@ -33,6 +33,7 @@ import com.owncloud.android.lib.resources.files.MoveRemoteFileOperation
 | 
				
			|||||||
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.RemoveRemoteFileOperation
 | 
					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
 | 
					import com.owncloud.android.lib.resources.files.services.FileService
 | 
				
			||||||
 | 
					
 | 
				
			||||||
class OCFileService(override val client: OwnCloudClient) : FileService {
 | 
					class OCFileService(override val client: OwnCloudClient) : FileService {
 | 
				
			||||||
@ -78,11 +79,30 @@ class OCFileService(override val client: OwnCloudClient) : FileService {
 | 
				
			|||||||
            targetRemotePath = targetRemotePath,
 | 
					            targetRemotePath = targetRemotePath,
 | 
				
			||||||
        ).execute(client)
 | 
					        ).execute(client)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    override fun refreshFolder(remotePath: String): RemoteOperationResult<ArrayList<RemoteFile>> =
 | 
					    override fun refreshFolder(
 | 
				
			||||||
 | 
					        remotePath: String
 | 
				
			||||||
 | 
					    ): RemoteOperationResult<ArrayList<RemoteFile>> =
 | 
				
			||||||
        ReadRemoteFolderOperation(
 | 
					        ReadRemoteFolderOperation(
 | 
				
			||||||
            remotePath = remotePath
 | 
					            remotePath = remotePath
 | 
				
			||||||
        ).execute(client)
 | 
					        ).execute(client)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    override fun removeFile(remotePath: String): RemoteOperationResult<Unit> =
 | 
					    override fun removeFile(
 | 
				
			||||||
        RemoveRemoteFileOperation(remotePath = remotePath).execute(client)
 | 
					        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