aboutsummaryrefslogtreecommitdiff
path: root/src/org/traccar/Config.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/org/traccar/Config.java')
-rw-r--r--src/org/traccar/Config.java20
1 files changed, 10 insertions, 10 deletions
diff --git a/src/org/traccar/Config.java b/src/org/traccar/Config.java
index 90f064601..85a47cf66 100644
--- a/src/org/traccar/Config.java
+++ b/src/org/traccar/Config.java
@@ -22,23 +22,23 @@ import java.util.Properties;
public class Config {
private final Properties properties = new Properties();
-
+
public void load(String file) throws IOException {
properties.loadFromXML(new FileInputStream(file));
}
-
+
public boolean hasKey(String key) {
return properties.containsKey(key);
}
-
+
public boolean getBoolean(String key) {
return Boolean.valueOf(properties.getProperty(key));
}
-
+
public int getInteger(String key) {
return getInteger(key, 0);
}
-
+
public int getInteger(String key, int defaultValue) {
if (properties.containsKey(key)) {
return Integer.valueOf(properties.getProperty(key));
@@ -46,11 +46,11 @@ public class Config {
return defaultValue;
}
}
-
+
public long getLong(String key) {
return getLong(key, 0);
}
-
+
public long getLong(String key, long defaultValue) {
if (properties.containsKey(key)) {
return Long.valueOf(properties.getProperty(key));
@@ -58,11 +58,11 @@ public class Config {
return defaultValue;
}
}
-
+
public String getString(String key) {
return properties.getProperty(key);
}
-
+
public String getString(String key, String defaultValue) {
if (properties.containsKey(key)) {
return properties.getProperty(key);
@@ -70,5 +70,5 @@ public class Config {
return defaultValue;
}
}
-
+
}