Adds mkdirs to TemporaryFileCreator

This commit is contained in:
ericdecanini 2022-04-13 12:42:21 +02:00
parent 0bf84341af
commit eb3f704745

View file

@ -28,7 +28,10 @@ internal class TemporaryFileCreator @Inject constructor(
) {
suspend fun create(): File {
return withContext(Dispatchers.IO) {
File.createTempFile(UUID.randomUUID().toString(), null, context.cacheDir)
runCatching {
File.createTempFile(UUID.randomUUID().toString(), null, context.cacheDir)
.apply { mkdirs() }
}.getOrThrow()
}
}
}