mirror of
https://github.com/owncloud/android-library.git
synced 2025-06-07 07:56:19 +00:00
Add support for spaces web dav specific urls to the rename operation
This commit is contained in:
parent
9c844aae7e
commit
78665e8cb0
@ -48,6 +48,7 @@ class RenameRemoteFileOperation(
|
||||
private val oldRemotePath: String,
|
||||
private val newName: String,
|
||||
isFolder: Boolean,
|
||||
val spaceWebDavUrl: String? = null,
|
||||
) : RemoteOperation<Unit>() {
|
||||
|
||||
private var newRemotePath: String
|
||||
@ -75,8 +76,8 @@ class RenameRemoteFileOperation(
|
||||
}
|
||||
|
||||
val moveMethod: MoveMethod = MoveMethod(
|
||||
url = URL(client.userFilesWebDavUri.toString() + WebdavUtils.encodePath(oldRemotePath)),
|
||||
destinationUrl = client.userFilesWebDavUri.toString() + WebdavUtils.encodePath(newRemotePath),
|
||||
url = URL((spaceWebDavUrl ?: client.userFilesWebDavUri.toString()) + WebdavUtils.encodePath(oldRemotePath)),
|
||||
destinationUrl = (spaceWebDavUrl ?: client.userFilesWebDavUri.toString()) + WebdavUtils.encodePath(newRemotePath),
|
||||
).apply {
|
||||
setReadTimeout(RENAME_READ_TIMEOUT, TimeUnit.MILLISECONDS)
|
||||
setConnectionTimeout(RENAME_CONNECTION_TIMEOUT, TimeUnit.MILLISECONDS)
|
||||
|
@ -77,5 +77,6 @@ interface FileService : Service {
|
||||
oldRemotePath: String,
|
||||
newName: String,
|
||||
isFolder: Boolean,
|
||||
spaceWebDavUrl: String? = null,
|
||||
): RemoteOperationResult<Unit>
|
||||
}
|
||||
|
@ -123,12 +123,14 @@ class OCFileService(override val client: OwnCloudClient) : FileService {
|
||||
oldName: String,
|
||||
oldRemotePath: String,
|
||||
newName: String,
|
||||
isFolder: Boolean
|
||||
isFolder: Boolean,
|
||||
spaceWebDavUrl: String?,
|
||||
): RemoteOperationResult<Unit> =
|
||||
RenameRemoteFileOperation(
|
||||
oldName = oldName,
|
||||
oldRemotePath = oldRemotePath,
|
||||
newName = newName,
|
||||
isFolder = isFolder
|
||||
isFolder = isFolder,
|
||||
spaceWebDavUrl = spaceWebDavUrl,
|
||||
).execute(client)
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user