diff options
author | Anton Tananaev <anton.tananaev@gmail.com> | 2016-12-19 08:01:20 +1300 |
---|---|---|
committer | Anton Tananaev <anton.tananaev@gmail.com> | 2016-12-19 08:01:20 +1300 |
commit | 54e738d3281a463a0ea3fcf2026c2464529a9b58 (patch) | |
tree | 65e924f480d6489a5939d2f289c354240fd68e59 /src/org/traccar/WebDataHandler.java | |
parent | 99f09134fb9c710114296d603c97a76f5cfb0d2a (diff) | |
download | trackermap-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.java | 7 |
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); } } |