aboutsummaryrefslogtreecommitdiff
path: root/src/org/traccar/protocol/Gt06ProtocolDecoder.java
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2015-07-12 17:54:00 +1200
committerAnton Tananaev <anton.tananaev@gmail.com>2015-07-12 17:54:00 +1200
commita2dac324574dde8fe8e57bd46dd7f94d0fb60231 (patch)
tree061e957cb53e00214a33acb6317be9c0849c50fa /src/org/traccar/protocol/Gt06ProtocolDecoder.java
parentf1ae2d73584d4ddded6f727c665d97f03ecf9c25 (diff)
downloadtrackermap-server-a2dac324574dde8fe8e57bd46dd7f94d0fb60231.tar.gz
trackermap-server-a2dac324574dde8fe8e57bd46dd7f94d0fb60231.tar.bz2
trackermap-server-a2dac324574dde8fe8e57bd46dd7f94d0fb60231.zip
Re-factor configuration access
Diffstat (limited to 'src/org/traccar/protocol/Gt06ProtocolDecoder.java')
-rw-r--r--src/org/traccar/protocol/Gt06ProtocolDecoder.java16
1 files changed, 6 insertions, 10 deletions
diff --git a/src/org/traccar/protocol/Gt06ProtocolDecoder.java b/src/org/traccar/protocol/Gt06ProtocolDecoder.java
index 5e527dd9c..06c3985dc 100644
--- a/src/org/traccar/protocol/Gt06ProtocolDecoder.java
+++ b/src/org/traccar/protocol/Gt06ProtocolDecoder.java
@@ -15,10 +15,12 @@
*/
package org.traccar.protocol;
+import java.net.SocketAddress;
+import java.util.Calendar;
+import java.util.TimeZone;
import org.jboss.netty.buffer.ChannelBuffer;
import org.jboss.netty.buffer.ChannelBuffers;
import org.jboss.netty.channel.Channel;
-import org.jboss.netty.channel.ChannelHandlerContext;
import org.traccar.BaseProtocolDecoder;
import org.traccar.Context;
import org.traccar.helper.Crc;
@@ -26,11 +28,6 @@ import org.traccar.helper.UnitsConverter;
import org.traccar.model.Event;
import org.traccar.model.Position;
-import java.net.SocketAddress;
-import java.util.Calendar;
-import java.util.Properties;
-import java.util.TimeZone;
-
public class Gt06ProtocolDecoder extends BaseProtocolDecoder {
private boolean forceTimeZone = false;
@@ -38,11 +35,10 @@ public class Gt06ProtocolDecoder extends BaseProtocolDecoder {
public Gt06ProtocolDecoder(Gt06Protocol protocol) {
super(protocol);
-
- Properties properties = Context.getProps();
- if (properties != null && properties.containsKey(protocol + ".timezone")) {
+
+ if (Context.getConfig().hasKey(protocol + ".timezone")) {
forceTimeZone = true;
- timeZone.setRawOffset(Integer.valueOf(properties.getProperty(protocol + ".timezone")) * 1000);
+ timeZone.setRawOffset(Context.getConfig().getInteger(protocol + ".timezone") * 1000);
}
}