fix #1769 export overwrite existing files

This commit is contained in:
Peter Storch
2023-11-27 20:34:08 +01:00
committed by Dennis Guse
parent a01edcc9e8
commit 87d7ebcb64
@@ -68,7 +68,7 @@ public class ExportUtils {
}
TrackExporter trackExporter = exportTask.getTrackFileFormat().createTrackExporter(context, contentProviderUtils);
try (OutputStream outputStream = context.getContentResolver().openOutputStream(exportDocumentFileUri)) {
try (OutputStream outputStream = context.getContentResolver().openOutputStream(exportDocumentFileUri, "wt")) {
if (!trackExporter.writeTrack(tracks, outputStream)) {
if (!DocumentFile.fromSingleUri(context, exportDocumentFileUri).delete()) {
throw new RuntimeException("Unable to delete exportDocumentFile");