aboutsummaryrefslogtreecommitdiff
path: root/src/org/traccar/WebDataHandler.java
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2016-12-19 08:01:20 +1300
committerAnton Tananaev <anton.tananaev@gmail.com>2016-12-19 08:01:20 +1300
commit54e738d3281a463a0ea3fcf2026c2464529a9b58 (patch)
tree65e924f480d6489a5939d2f289c354240fd68e59 /src/org/traccar/WebDataHandler.java
parent99f09134fb9c710114296d603c97a76f5cfb0d2a (diff)
downloadtrackermap-server-54e738d3281a463a0ea3fcf2026c2464529a9b58.tar.gz
trackermap-server-54e738d3281a463a0ea3fcf2026c2464529a9b58.tar.bz2
trackermap-server-54e738d3281a463a0ea3fcf2026c2464529a9b58.zip
Remove own JSON converter
Diffstat (limited to 'src/org/traccar/WebDataHandler.java')
-rw-r--r--src/org/traccar/WebDataHandler.java7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/org/traccar/WebDataHandler.java b/src/org/traccar/WebDataHandler.java
index f99d7c97a..eaf0978ef 100644
--- a/src/org/traccar/WebDataHandler.java
+++ b/src/org/traccar/WebDataHandler.java
@@ -15,10 +15,10 @@
*/
package org.traccar;
+import com.fasterxml.jackson.core.JsonProcessingException;
import org.traccar.helper.Checksum;
import org.traccar.helper.Log;
import org.traccar.model.Device;
-import org.traccar.model.MiscFormatter;
import org.traccar.model.Position;
import java.io.UnsupportedEncodingException;
@@ -77,8 +77,6 @@ public class WebDataHandler extends BaseDataHandler {
Device device = Context.getIdentityManager().getDeviceById(position.getDeviceId());
- String attributes = MiscFormatter.toJsonString(position.getAttributes());
-
String request = url
.replace("{name}", device.getName())
.replace("{uniqueId}", device.getUniqueId())
@@ -105,9 +103,10 @@ public class WebDataHandler extends BaseDataHandler {
if (request.contains("{attributes}")) {
try {
+ String attributes = Context.getObjectMapper().writeValueAsString(position.getAttributes());
request = request.replace(
"{attributes}", URLEncoder.encode(attributes, StandardCharsets.UTF_8.name()));
- } catch (UnsupportedEncodingException error) {
+ } catch (UnsupportedEncodingException | JsonProcessingException error) {
Log.warning(error);
}
}