Fix downloading/exporting when overwriting file would not truncate
This commit is contained in:
parent
8af786f26d
commit
c80c378398
3 changed files with 15 additions and 3 deletions
|
|
@ -24,8 +24,7 @@ class ImportExportManager(private val fileLocator: BackupFileLocator) {
|
|||
*/
|
||||
@Throws(Exception::class)
|
||||
fun exportDatabase(preferences: SharedPreferences, file: StoredFileHelper) {
|
||||
file.create()
|
||||
ZipOutputStream(SharpOutputStream(file.stream).buffered()).use { outZip ->
|
||||
ZipOutputStream(SharpOutputStream(file.openAndTruncateStream()).buffered()).use { outZip ->
|
||||
// add the database
|
||||
ZipHelper.addFileToZip(
|
||||
outZip,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue