mirror of
https://gitlab.com/ultrasonic/ultrasonic.git
synced 2025-06-06 10:33:05 +03:00
Merge branch 'fixDownload' into 'develop'
Fix Download bug in Custom Locations See merge request ultrasonic/ultrasonic!847
This commit is contained in:
commit
c93ef240b4
@ -87,14 +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")
|
||||||
val stream = descriptor?.createOutputStream()
|
|
||||||
?: throw IOException("Couldn't retrieve OutputStream")
|
|
||||||
descriptor.close()
|
|
||||||
return stream
|
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun getFileInputStream(): InputStream {
|
override fun getFileInputStream(): InputStream {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user