mirror of
https://gitlab.com/ultrasonic/ultrasonic.git
synced 2025-06-20 17:03:57 +03:00
Fix it properly
This commit is contained in:
parent
7505166283
commit
ec49fae666
@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
* StorageFile.kt
|
* StorageFile.kt
|
||||||
* Copyright (C) 2009-2021 Ultrasonic developers
|
* Copyright (C) 2009-2022 Ultrasonic developers
|
||||||
*
|
*
|
||||||
* Distributed under terms of the GNU GPLv3 license.
|
* Distributed under terms of the GNU GPLv3 license.
|
||||||
*/
|
*/
|
||||||
@ -87,12 +87,10 @@ class StorageFile(
|
|||||||
|
|
||||||
override fun getFileOutputStream(append: Boolean): OutputStream {
|
override fun getFileOutputStream(append: Boolean): OutputStream {
|
||||||
val mode = if (append) "wa" else "w"
|
val mode = if (append) "wa" else "w"
|
||||||
val descriptor = UApp.applicationContext().contentResolver.openAssetFileDescriptor(
|
return UApp.applicationContext().contentResolver.openOutputStream(
|
||||||
uri,
|
uri,
|
||||||
mode
|
mode
|
||||||
)
|
) ?: throw IOException("Couldn't retrieve OutputStream")
|
||||||
return descriptor?.createOutputStream()
|
|
||||||
?: throw IOException("Couldn't retrieve OutputStream")
|
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun getFileInputStream(): InputStream {
|
override fun getFileInputStream(): InputStream {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user