Skip to content

Commit

Permalink
Fixes #1655
Browse files Browse the repository at this point in the history
  • Loading branch information
mtotschnig committed Feb 20, 2025
1 parent 8ead8bc commit b093619
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ import com.google.gson.Gson
import com.google.gson.GsonBuilder
import com.google.gson.reflect.TypeToken
import kotlinx.serialization.ExperimentalSerializationApi
import kotlinx.serialization.encodeToString
import kotlinx.serialization.json.Json
import kotlinx.serialization.json.decodeFromStream
import org.apache.commons.lang3.StringUtils
Expand Down Expand Up @@ -50,7 +49,6 @@ import org.totschnig.myexpenses.util.io.getNameWithoutExtension
import java.io.*
import java.security.GeneralSecurityException
import java.util.*
import kotlin.collections.contains

abstract class AbstractSyncBackendProvider<Res>(protected val context: Context) :
SyncBackendProvider, ResourceStorage<Res> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -233,11 +233,6 @@ class WebDavBackendProvider @SuppressLint("MissingPermission") internal construc
val base = if (toAccountDir) accountRes else webDavClient.base
val parent = if (folder != null) {
webDavClient.mkCol(folder, base)
webDavClient.getCollection(folder, accountUuid).also {
if (!it.exists()) {
throw IOException("Cannot make folder")
}
}
} else base
saveFileContents(fileName, fileContents, mimeType, maybeEncrypt, parent)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -134,11 +134,10 @@ class WebDavClient(
}

@Throws(IOException::class)
fun mkCol(folderName: String, parent: DavResource) {
val folder =
LockableDavResource(httpClient, buildCollectionUri(folderName, parent.location))
folder.mkColWithLock(buildIfHeader(parent.location))
}
fun mkCol(folderName: String, parent: DavResource) =
LockableDavResource(httpClient, buildCollectionUri(folderName, parent.location)).also {
it.mkColWithLock(buildIfHeader(parent.location))
}

/**
* @param folderPath if null, members of base uri are returned
Expand Down

0 comments on commit b093619

Please sign in to comment.