Mercurial > dive4elements > river
comparison artifacts/src/main/java/org/dive4elements/river/artifacts/uinfo/inundationduration/UedauernPropertiesHelper.java @ 9194:c373909fb7ca
Fixed: used java 7 feature although java 6 comliance level is configured
author | gernotbelger |
---|---|
date | Fri, 29 Jun 2018 13:09:29 +0200 |
parents | 0633f963c5be |
children | fb5272746c74 |
comparison
equal
deleted
inserted
replaced
9193:f6b7837b89aa | 9194:c373909fb7ca |
---|---|
7 * and comes with ABSOLUTELY NO WARRANTY! Check out the | 7 * and comes with ABSOLUTELY NO WARRANTY! Check out the |
8 * documentation coming with Dive4Elements River for details. | 8 * documentation coming with Dive4Elements River for details. |
9 */ | 9 */ |
10 package org.dive4elements.river.artifacts.uinfo.inundationduration; | 10 package org.dive4elements.river.artifacts.uinfo.inundationduration; |
11 | 11 |
12 import java.io.IOException; | |
12 import java.util.HashMap; | 13 import java.util.HashMap; |
13 import java.util.LinkedHashMap; | 14 import java.util.LinkedHashMap; |
14 import java.util.Map; | 15 import java.util.Map; |
15 import java.util.Properties; | 16 import java.util.Properties; |
16 | 17 |
67 return entries; | 68 return entries; |
68 } | 69 } |
69 | 70 |
70 private Properties getProperties() { | 71 private Properties getProperties() { |
71 if (this.properties == null) { | 72 if (this.properties == null) { |
72 this.properties = Config.loadProperties(this.CONFIG_FILE); | 73 try { |
74 this.properties = Config.loadProperties(this.CONFIG_FILE); | |
75 } | |
76 catch (final IOException e) { | |
77 e.printStackTrace(); | |
78 } | |
73 } | 79 } |
74 return this.properties; | 80 return this.properties; |
75 } | 81 } |
76 | 82 |
77 final Integer[] getMittelStartEnd() { | 83 final Integer[] getMittelStartEnd() { |
110 final String yearUrl = subst.replace(templateUrl); | 116 final String yearUrl = subst.replace(templateUrl); |
111 return yearUrl; | 117 return yearUrl; |
112 } | 118 } |
113 | 119 |
114 public static boolean fileExistsForRiver(final String river) { | 120 public static boolean fileExistsForRiver(final String river) { |
115 final Properties properties = Config.loadProperties(makeFileName(river)); | 121 try { |
116 if (properties.size() == 0) { | 122 Config.loadProperties(makeFileName(river)); |
123 return true; | |
124 } | |
125 catch (final IOException e) { | |
126 e.printStackTrace(); | |
117 return false; | 127 return false; |
118 } | 128 } |
119 return true; | |
120 } | 129 } |
121 | 130 |
122 public String getScenarioUrlFromYear(final Integer year, final Integer dMwspl) { | 131 public String getScenarioUrlFromYear(final Integer year, final Integer dMwspl) { |
123 // besser kein lazy-loading, da der user nochmal zurück gehen und das Jahr ändern könnte... | 132 // besser kein lazy-loading, da der user nochmal zurück gehen und das Jahr ändern könnte... |
124 final String templateUrl = getProperties().get("scenario_url").toString(); | 133 final String templateUrl = getProperties().get("scenario_url").toString(); |