1
0
mirror of https://github.com/owncloud/android-library.git synced 2025-06-06 15:36:45 +00:00

Merge pull request #581 from owncloud/release/4.1

[RELEASE] 4.1 library to master
This commit is contained in:
Aitorbp 2023-09-05 09:49:55 +01:00 committed by GitHub
commit 71224c30d1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 3 deletions

View File

@ -54,8 +54,7 @@ class CheckPathExistenceRemoteOperation(
) : RemoteOperation<Boolean>() {
override fun run(client: OwnCloudClient): RemoteOperationResult<Boolean> {
val baseStringUrl = spaceWebDavUrl ?: if (isUserLoggedIn) client.baseFilesWebDavUri.toString() + WebdavUtils.encodePath(remotePath)
else client.userFilesWebDavUri.toString()
val baseStringUrl = spaceWebDavUrl ?: if (isUserLoggedIn) client.userFilesWebDavUri.toString() else client.baseFilesWebDavUri.toString()
val stringUrl = if (isUserLoggedIn) baseStringUrl + WebdavUtils.encodePath(remotePath) else baseStringUrl
return try {
@ -81,6 +80,7 @@ class CheckPathExistenceRemoteOperation(
e,
"Existence check for $stringUrl : ${result.logMessage}"
)
result.data = false
result
}
}

View File

@ -106,7 +106,7 @@ class RenameRemoteFileOperation(
* @return 'True' if the target path is already used by an existing file.
*/
private fun targetPathIsUsed(client: OwnCloudClient): Boolean {
val checkPathExistenceRemoteOperation = CheckPathExistenceRemoteOperation(newRemotePath, false)
val checkPathExistenceRemoteOperation = CheckPathExistenceRemoteOperation(newRemotePath, true)
val exists = checkPathExistenceRemoteOperation.execute(client)
return exists.isSuccess
}