For #27269: Use parentFile method over substring extraction

This fixes gradle tests on Windows, where the file separator is "\"
and not "/".
This commit is contained in:
Alexander Gramiak 2022-10-14 16:53:20 -06:00 committed by mergify[bot]
parent 35e0afe329
commit f352a4f9dc
1 changed files with 1 additions and 1 deletions

View File

@ -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())
}