diff options
author | Anton Tananaev <anton.tananaev@gmail.com> | 2020-12-27 17:59:19 -0800 |
---|---|---|
committer | Anton Tananaev <anton.tananaev@gmail.com> | 2020-12-27 17:59:19 -0800 |
commit | 2377f5746ffb8a3364ad65a382ca5fce3fe11e87 (patch) | |
tree | 88340e1746fdb3774f7a25f6fccd05531eac8a75 /src/main/java/org/traccar/api/resource | |
parent | 21e5246ace0f6ecfd00248e5d29fd64a564e03c1 (diff) | |
download | trackermap-server-2377f5746ffb8a3364ad65a382ca5fce3fe11e87.tar.gz trackermap-server-2377f5746ffb8a3364ad65a382ca5fce3fe11e87.tar.bz2 trackermap-server-2377f5746ffb8a3364ad65a382ca5fce3fe11e87.zip |
Remove GPX and CSV export
Diffstat (limited to 'src/main/java/org/traccar/api/resource')
-rw-r--r-- | src/main/java/org/traccar/api/resource/PositionResource.java | 33 |
1 files changed, 0 insertions, 33 deletions
diff --git a/src/main/java/org/traccar/api/resource/PositionResource.java b/src/main/java/org/traccar/api/resource/PositionResource.java index e93feaccf..998d59706 100644 --- a/src/main/java/org/traccar/api/resource/PositionResource.java +++ b/src/main/java/org/traccar/api/resource/PositionResource.java @@ -18,18 +18,13 @@ package org.traccar.api.resource; import org.traccar.Context; import org.traccar.api.BaseResource; import org.traccar.model.Position; -import org.traccar.web.CsvBuilder; -import org.traccar.web.GpxBuilder; import javax.ws.rs.Consumes; import javax.ws.rs.GET; import javax.ws.rs.Path; import javax.ws.rs.Produces; import javax.ws.rs.QueryParam; -import javax.ws.rs.core.HttpHeaders; import javax.ws.rs.core.MediaType; -import javax.ws.rs.core.Response; - import java.sql.SQLException; import java.util.ArrayList; import java.util.Collection; @@ -42,11 +37,6 @@ import java.util.List; @Consumes(MediaType.APPLICATION_JSON) public class PositionResource extends BaseResource { - public static final String TEXT_CSV = "text/csv"; - public static final String CONTENT_DISPOSITION_VALUE_CSV = "attachment; filename=positions.csv"; - public static final String GPX = "application/gpx+xml"; - public static final String CONTENT_DISPOSITION_VALUE_GPX = "attachment; filename=positions.gpx"; - @GET public Collection<Position> getJson( @QueryParam("deviceId") long deviceId, @QueryParam("id") List<Long> positionIds, @@ -72,27 +62,4 @@ public class PositionResource extends BaseResource { } } - @GET - @Produces(TEXT_CSV) - public Response getCsv( - @QueryParam("deviceId") long deviceId, @QueryParam("from") Date from, @QueryParam("to") Date to) - throws SQLException { - Context.getPermissionsManager().checkDevice(getUserId(), deviceId); - CsvBuilder csv = new CsvBuilder(); - csv.addHeaderLine(new Position()); - csv.addArray(Context.getDataManager().getPositions(deviceId, from, to)); - return Response.ok(csv.build()).header(HttpHeaders.CONTENT_DISPOSITION, CONTENT_DISPOSITION_VALUE_CSV).build(); - } - - @GET - @Produces(GPX) - public Response getGpx( - @QueryParam("deviceId") long deviceId, @QueryParam("from") Date from, @QueryParam("to") Date to) - throws SQLException { - Context.getPermissionsManager().checkDevice(getUserId(), deviceId); - GpxBuilder gpx = new GpxBuilder(Context.getIdentityManager().getById(deviceId).getName()); - gpx.addPositions(Context.getDataManager().getPositions(deviceId, from, to)); - return Response.ok(gpx.build()).header(HttpHeaders.CONTENT_DISPOSITION, CONTENT_DISPOSITION_VALUE_GPX).build(); - } - } |