fix: Create Keyguard downloads directory if it doesn't exist
This commit is contained in:
parent
4bd16a82a8
commit
64c0b37558
|
@ -49,6 +49,9 @@ class DirsServiceAndroid(
|
|||
val downloadsDir = Environment
|
||||
.getExternalStoragePublicDirectory(Environment.DIRECTORY_DOWNLOADS)
|
||||
val file = downloadsDir.resolve(fileName)
|
||||
// Ensure the parent directory does exist
|
||||
// before writing the file.
|
||||
file.parentFile?.mkdirs()
|
||||
file.outputStream()
|
||||
.use {
|
||||
write(it)
|
||||
|
|
|
@ -47,6 +47,9 @@ class DataDirectory(
|
|||
.bind()
|
||||
.let(::File)
|
||||
val file = downloadsDir.resolve(fileName)
|
||||
// Ensure the parent directory does exist
|
||||
// before writing the file.
|
||||
file.parentFile?.mkdirs()
|
||||
file.outputStream()
|
||||
.use {
|
||||
write(it)
|
||||
|
|
Loading…
Reference in New Issue