Skip to content

Commit

Permalink
fix #1769 export overwrite existing files
Browse files Browse the repository at this point in the history
  • Loading branch information
pstorch committed Nov 28, 2023
1 parent a01edcc commit dfd5b56
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ public static void exportTrack(Context context, DocumentFile directory, ExportTa
}

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");
Expand Down

0 comments on commit dfd5b56

Please sign in to comment.