From 980d87ad01e5d962406e1f2d75c8584c5a00cf81 Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Mon, 28 Dec 2020 22:30:27 -0800 Subject: Use defined keys --- src/main/java/org/traccar/Context.java | 4 ++-- src/main/java/org/traccar/api/HealthCheckService.java | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'src/main/java') diff --git a/src/main/java/org/traccar/Context.java b/src/main/java/org/traccar/Context.java index d23314c06..3614497af 100644 --- a/src/main/java/org/traccar/Context.java +++ b/src/main/java/org/traccar/Context.java @@ -363,12 +363,12 @@ public final class Context { String address; try { - address = config.getString("web.address", InetAddress.getLocalHost().getHostAddress()); + address = config.getString(Keys.WEB_ADDRESS, InetAddress.getLocalHost().getHostAddress()); } catch (UnknownHostException e) { address = "localhost"; } - String webUrl = URIUtil.newURI("http", address, config.getInteger("web.port", 8082), "", ""); + String webUrl = URIUtil.newURI("http", address, config.getInteger(Keys.WEB_PORT), "", ""); webUrl = Context.getConfig().getString("web.url", webUrl); velocityProperties.setProperty("web.url", webUrl); diff --git a/src/main/java/org/traccar/api/HealthCheckService.java b/src/main/java/org/traccar/api/HealthCheckService.java index c9ce5a6c9..0182cc358 100644 --- a/src/main/java/org/traccar/api/HealthCheckService.java +++ b/src/main/java/org/traccar/api/HealthCheckService.java @@ -61,8 +61,8 @@ public class HealthCheckService { } private String getUrl() { - String address = Context.getConfig().getString("web.address", "localhost"); - int port = Context.getConfig().getInteger("web.port", 8082); + String address = Context.getConfig().getString(Keys.WEB_ADDRESS, "localhost"); + int port = Context.getConfig().getInteger(Keys.WEB_PORT); return "http://" + address + ":" + port + "/api/server"; } -- cgit v1.2.3