mirror of
https://github.com/owncloud/android-library.git
synced 2025-06-05 23:16:13 +00:00
Merge pull request #581 from owncloud/release/4.1
[RELEASE] 4.1 library to master
This commit is contained in:
commit
71224c30d1
@ -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
|
||||
}
|
||||
}
|
||||
|
@ -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
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user