Mercurial > dive4elements > river
diff artifacts/src/main/java/org/dive4elements/river/artifacts/sinfo/tkhstate/DefaultBedHeights.java @ 9178:2f5052835b76
uinfo inundationduration langjÀhr. Mittel, Uedauern.properties, Meldung
author | gernotbelger |
---|---|
date | Tue, 26 Jun 2018 19:48:35 +0200 |
parents | 28eec75415d8 |
children | ed4b14389667 |
line wrap: on
line diff
--- a/artifacts/src/main/java/org/dive4elements/river/artifacts/sinfo/tkhstate/DefaultBedHeights.java Tue Jun 26 16:17:30 2018 +0200 +++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/sinfo/tkhstate/DefaultBedHeights.java Tue Jun 26 19:48:35 2018 +0200 @@ -9,11 +9,6 @@ */ package org.dive4elements.river.artifacts.sinfo.tkhstate; -import java.io.File; -import java.io.IOException; -import java.io.InputStreamReader; -import java.nio.charset.StandardCharsets; -import java.nio.file.Files; import java.util.ArrayList; import java.util.Arrays; import java.util.Collection; @@ -84,13 +79,9 @@ } private static Collection<String> loadBedHeightDefaultsForRiver(final River river, final Calculation problems) { - final File configDir = Config.getConfigDirectory(); - final File configFile = new File(configDir, CONFIG_FILE); - final Properties properties = new Properties(); - try (final InputStreamReader reader = new InputStreamReader(Files.newInputStream(configFile.toPath()), StandardCharsets.ISO_8859_1)) { - properties.load(reader); - + try { + final Properties properties = Config.loadProperties(CONFIG_FILE); final String value = properties.getProperty(river.getName()); final String[] split = StringUtils.split(StringUtils.trim(value), ','); if (ArrayUtils.isEmpty(split)) { @@ -100,7 +91,9 @@ return Arrays.asList(split); } - catch (final IOException e) { + catch ( + + final Exception e) { e.printStackTrace(); problems.addProblem("sinfo.bedheightsfinder.configfile.loaderror", CONFIG_FILE, e.getMessage()); return Collections.emptyList();