diff options
Diffstat (limited to 'src/org/traccar/Config.java')
-rw-r--r-- | src/org/traccar/Config.java | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/org/traccar/Config.java b/src/org/traccar/Config.java index 719f23038..49d6e4fde 100644 --- a/src/org/traccar/Config.java +++ b/src/org/traccar/Config.java @@ -17,6 +17,7 @@ package org.traccar; import java.io.FileInputStream; import java.io.IOException; +import java.io.InputStream; import java.util.Properties; public class Config { @@ -24,7 +25,9 @@ public class Config { private final Properties properties = new Properties(); public void load(String file) throws IOException { - properties.loadFromXML(new FileInputStream(file)); + try (InputStream inputStream = new FileInputStream(file)) { + properties.loadFromXML(inputStream); + } } public boolean hasKey(String key) { |