forked from upstream-mirrors/OpenTracks
fix #1769 export overwrite existing files
This commit is contained in:
committed by
Dennis Guse
parent
a01edcc9e8
commit
87d7ebcb64
@@ -68,7 +68,7 @@ public class ExportUtils {
|
|||||||
}
|
}
|
||||||
|
|
||||||
TrackExporter trackExporter = exportTask.getTrackFileFormat().createTrackExporter(context, contentProviderUtils);
|
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 (!trackExporter.writeTrack(tracks, outputStream)) {
|
||||||
if (!DocumentFile.fromSingleUri(context, exportDocumentFileUri).delete()) {
|
if (!DocumentFile.fromSingleUri(context, exportDocumentFileUri).delete()) {
|
||||||
throw new RuntimeException("Unable to delete exportDocumentFile");
|
throw new RuntimeException("Unable to delete exportDocumentFile");
|
||||||
|
|||||||
Reference in New Issue
Block a user