mirror of
https://codeberg.org/OpenTracksApp/OpenTracks.git
synced 2026-10-03 01:53:05 +02:00
Simplify TrackExporter interface.
This commit is contained in:
@@ -23,8 +23,6 @@ import androidx.annotation.NonNull;
|
||||
import java.io.OutputStream;
|
||||
import java.io.PrintWriter;
|
||||
import java.text.NumberFormat;
|
||||
import java.util.Arrays;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
import java.util.function.Function;
|
||||
@@ -86,11 +84,6 @@ public class CSVTrackExporter implements TrackExporter {
|
||||
this.contentProviderUtils = contentProviderUtils;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean writeTrack(Track track, @NonNull OutputStream outputStream) {
|
||||
return writeTrack(List.of(track), outputStream);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean writeTrack(@NonNull List<Track> tracks, @NonNull OutputStream outputStream) {
|
||||
List<Column> columns = List.of(
|
||||
|
||||
@@ -97,11 +97,6 @@ public class GPXTrackExporter implements TrackExporter {
|
||||
this.creator = creator;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean writeTrack(Track track, @NonNull OutputStream outputStream) {
|
||||
return writeTrack(List.of(track), outputStream);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean writeTrack(List<Track> tracks, @NonNull OutputStream outputStream) {
|
||||
try {
|
||||
|
||||
@@ -99,10 +99,6 @@ public class KMLTrackExporter implements TrackExporter {
|
||||
this.contentProviderUtils = contentProviderUtils;
|
||||
}
|
||||
|
||||
public boolean writeTrack(Track track, @NonNull OutputStream outputStream) {
|
||||
return writeTrack(List.of(track), outputStream);
|
||||
}
|
||||
|
||||
public boolean writeTrack(List<Track> tracks, @NonNull OutputStream outputStream) {
|
||||
try {
|
||||
prepare(outputStream);
|
||||
|
||||
@@ -64,11 +64,6 @@ public class KmzTrackExporter implements TrackExporter {
|
||||
this.exportPhotos = exportPhotos;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean writeTrack(Track track, @NonNull OutputStream outputStream) {
|
||||
return writeTrack(List.of(track), outputStream);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean writeTrack(List<Track> tracks, @NonNull OutputStream outputStream) {
|
||||
try (ZipOutputStream zipOutputStream = new ZipOutputStream(outputStream)) {
|
||||
|
||||
@@ -31,7 +31,4 @@ import de.dennisguse.opentracks.data.models.Track;
|
||||
public interface TrackExporter {
|
||||
|
||||
boolean writeTrack(List<Track> tracks, @NonNull OutputStream outputStream);
|
||||
|
||||
@Deprecated // Only used for tests
|
||||
boolean writeTrack(Track track, @NonNull OutputStream outputStream);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user