1
0
mirror of https://github.com/owncloud/android-library.git synced 2025-06-07 16:06:08 +00:00

Apply code review suggestions

This commit is contained in:
Abel García de Prada 2021-05-24 11:27:44 +02:00 committed by Abel García de Prada
parent 6f33dca672
commit f7645c1648

View File

@ -53,9 +53,11 @@ class RenameRemoteFileOperation(
private var newRemotePath: String
init {
var parent = (File(oldRemotePath)).parent!!
parent = if (parent.endsWith(File.separator)) parent else parent + File.separator
newRemotePath = parent + newName
var parent = (File(oldRemotePath)).parent ?: throw IllegalArgumentException()
if (!parent.endsWith(File.separator)) {
parent = parent.plus(File.separator)
}
newRemotePath = parent.plus(newName)
if (isFolder) {
newRemotePath.plus(File.separator)
}