Mercurial > dive4elements > river
comparison artifacts/src/main/java/org/dive4elements/river/artifacts/uinfo/inundationduration/UedauernPropertiesHelper.java @ 9197:fb5272746c74
compile error fix
author | gernotbelger |
---|---|
date | Fri, 29 Jun 2018 15:11:22 +0200 |
parents | c373909fb7ca |
children | 810f47bba83e |
comparison
equal
deleted
inserted
replaced
9196:87c08fa2da86 | 9197:fb5272746c74 |
---|---|
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; | |
13 import java.util.HashMap; | 12 import java.util.HashMap; |
14 import java.util.LinkedHashMap; | 13 import java.util.LinkedHashMap; |
15 import java.util.Map; | 14 import java.util.Map; |
16 import java.util.Properties; | 15 import java.util.Properties; |
17 | 16 |
68 return entries; | 67 return entries; |
69 } | 68 } |
70 | 69 |
71 private Properties getProperties() { | 70 private Properties getProperties() { |
72 if (this.properties == null) { | 71 if (this.properties == null) { |
73 try { | 72 this.properties = Config.loadProperties(this.CONFIG_FILE); |
74 this.properties = Config.loadProperties(this.CONFIG_FILE); | |
75 } | |
76 catch (final IOException e) { | |
77 e.printStackTrace(); | |
78 } | |
79 } | 73 } |
80 return this.properties; | 74 return this.properties; |
81 } | 75 } |
82 | 76 |
83 final Integer[] getMittelStartEnd() { | 77 final Integer[] getMittelStartEnd() { |
116 final String yearUrl = subst.replace(templateUrl); | 110 final String yearUrl = subst.replace(templateUrl); |
117 return yearUrl; | 111 return yearUrl; |
118 } | 112 } |
119 | 113 |
120 public static boolean fileExistsForRiver(final String river) { | 114 public static boolean fileExistsForRiver(final String river) { |
121 try { | 115 Config.loadProperties(makeFileName(river)); |
122 Config.loadProperties(makeFileName(river)); | 116 return true; |
123 return true; | |
124 } | |
125 catch (final IOException e) { | |
126 e.printStackTrace(); | |
127 return false; | |
128 } | |
129 } | 117 } |
130 | 118 |
131 public String getScenarioUrlFromYear(final Integer year, final Integer dMwspl) { | 119 public String getScenarioUrlFromYear(final Integer year, final Integer dMwspl) { |
132 // besser kein lazy-loading, da der user nochmal zurück gehen und das Jahr ändern könnte... | 120 // besser kein lazy-loading, da der user nochmal zurück gehen und das Jahr ändern könnte... |
133 final String templateUrl = getProperties().get("scenario_url").toString(); | 121 final String templateUrl = getProperties().get("scenario_url").toString(); |