For #27269: Use parentFile method over substring extraction

This fixes gradle tests on Windows, where the file separator is "\"
and not "/".
pull/543/head
Alexander Gramiak 2 years ago committed by mergify[bot]
parent 35e0afe329
commit f352a4f9dc

@ -80,7 +80,7 @@ class WallpaperDownloader(
if (!response.isSuccess) {
throw IllegalStateException()
}
File(localFile.path.substringBeforeLast("/")).mkdirs()
localFile.parentFile?.mkdirs()
response.body.useStream { input ->
input.copyTo(localFile.outputStream())
}

Loading…
Cancel
Save