changeset 9196:87c08fa2da86

Merge
author gernotbelger
date Fri, 29 Jun 2018 14:54:40 +0200
parents a4121ec450d6 (current diff) c373909fb7ca (diff)
children fb5272746c74
files
diffstat 2 files changed, 14 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/artifacts/src/main/java/org/dive4elements/river/artifacts/sinfo/tkhstate/DefaultBedHeights.java	Fri Jun 29 14:52:54 2018 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/sinfo/tkhstate/DefaultBedHeights.java	Fri Jun 29 14:54:40 2018 +0200
@@ -91,9 +91,7 @@
 
             return Arrays.asList(split);
         }
-        catch (
-
-        final Exception e) {
+        catch (final Exception e) {
             e.printStackTrace();
             problems.addProblem("sinfo.bedheightsfinder.configfile.loaderror", CONFIG_FILE, e.getMessage());
             return Collections.emptyList();
--- a/artifacts/src/main/java/org/dive4elements/river/artifacts/uinfo/inundationduration/UedauernPropertiesHelper.java	Fri Jun 29 14:52:54 2018 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/uinfo/inundationduration/UedauernPropertiesHelper.java	Fri Jun 29 14:54:40 2018 +0200
@@ -9,6 +9,7 @@
  */
 package org.dive4elements.river.artifacts.uinfo.inundationduration;
 
+import java.io.IOException;
 import java.util.HashMap;
 import java.util.LinkedHashMap;
 import java.util.Map;
@@ -69,7 +70,12 @@
 
     private Properties getProperties() {
         if (this.properties == null) {
-            this.properties = Config.loadProperties(this.CONFIG_FILE);
+            try {
+                this.properties = Config.loadProperties(this.CONFIG_FILE);
+            }
+            catch (final IOException e) {
+                e.printStackTrace();
+            }
         }
         return this.properties;
     }
@@ -112,11 +118,14 @@
     }
 
     public static boolean fileExistsForRiver(final String river) {
-        final Properties properties = Config.loadProperties(makeFileName(river));
-        if (properties.size() == 0) {
+        try {
+            Config.loadProperties(makeFileName(river));
+            return true;
+        }
+        catch (final IOException e) {
+            e.printStackTrace();
             return false;
         }
-        return true;
     }
 
     public String getScenarioUrlFromYear(final Integer year, final Integer dMwspl) {

http://dive4elements.wald.intevation.org