) to (depth >= 0)
)
} ?: FileStorage.instance.listDir(path)?.let { subEntries ->
- val subPaths = subEntries.keys.map { path / it }
- val subProps = subPaths.mapSuspend { subPath ->
- getWebDavPropertiesWithIncludeTags(subPath, webRoot, depth - 1)
- }.filterNotNull().flatten()
+ val subProps = subEntries.keys
+ .map { path / it }
+ .mapSuspend { subPath ->
+ getWebDavPropertiesWithIncludeTags(subPath, webRoot, depth - 1)
+ }
+ .filterNotNull()
+ .flatten()
val pathWithSuffix = path.elements.joinToString(separator = "") { "$it/" }
listOf(
suspend fun FileStorage.copyWebDav(source: StoragePath, target: StoragePath): Boolean {
return when (getType(source)) {
- StoredFileType.DIRECTORY -> createDir(target) && (listDir(source)?.let { subPaths ->
- val copyActions = subPaths.keys.map { (source / it) to (target / it) }
- copyActions.mapSuspend { (subSource, subTarget) ->
+ StoredFileType.DIRECTORY -> createDir(target) && (listDir(source)
+ ?.keys
+ ?.map { (source / it) to (target / it) }
+ ?.mapSuspend { (subSource, subTarget) ->
copyWebDav(subSource, subTarget)
- }.all { it }
- } == true)
+ }
+ ?.all { it } == true)
StoredFileType.FILE -> copyFile(source, target)