Mercurial > dive4elements > river
comparison backend/src/main/java/org/dive4elements/river/importer/ImportGauge.java @ 5932:c7951390fd58
Importer: Log an error if parsing a STA file failed.
author | Sascha L. Teichmann <teichmann@intevation.de> |
---|---|
date | Wed, 08 May 2013 17:52:54 +0200 |
parents | 4dd33b86dc61 |
children | 4c3ccf2b0304 |
comparison
equal
deleted
inserted
replaced
5931:5de1b9faebf5 | 5932:c7951390fd58 |
---|---|
161 this.mainValues = mainValues; | 161 this.mainValues = mainValues; |
162 } | 162 } |
163 | 163 |
164 public void parseDependencies() throws IOException { | 164 public void parseDependencies() throws IOException { |
165 StaFileParser sfp = new StaFileParser(); | 165 StaFileParser sfp = new StaFileParser(); |
166 sfp.parse(this); | 166 if (!sfp.parse(this)) { |
167 log.error("Parsing STA file failed."); | |
168 } | |
167 | 169 |
168 AtFileParser afp = new AtFileParser(); | 170 AtFileParser afp = new AtFileParser(); |
169 setDischargeTable(afp.parse(getAtFile())); | 171 setDischargeTable(afp.parse(getAtFile())); |
170 parseHistoricalDischargeTables(); | 172 parseHistoricalDischargeTables(); |
171 } | 173 } |
221 | 223 |
222 public void storeDependencies(River river) { | 224 public void storeDependencies(River river) { |
223 | 225 |
224 Gauge gauge = getPeer(river); | 226 Gauge gauge = getPeer(river); |
225 | 227 |
226 log.info("store main value types"); | 228 if (mainValueTypes != null) { |
227 for (ImportMainValueType mainValueType: mainValueTypes) { | 229 log.info("store main value types"); |
228 mainValueType.getPeer(); | 230 for (ImportMainValueType mainValueType: mainValueTypes) { |
229 } | 231 mainValueType.getPeer(); |
230 | 232 } |
231 log.info("store named main values"); | 233 } |
232 for (ImportNamedMainValue namedMainValue: namedMainValues) { | 234 |
233 namedMainValue.getPeer(); | 235 if (namedMainValues != null) { |
234 } | 236 log.info("store named main values"); |
235 | 237 for (ImportNamedMainValue namedMainValue: namedMainValues) { |
236 log.info("store main values"); | 238 namedMainValue.getPeer(); |
237 for (ImportMainValue mainValue: mainValues) { | 239 } |
238 mainValue.getPeer(river); | 240 } |
241 | |
242 if (mainValues != null) { | |
243 log.info("store main values"); | |
244 for (ImportMainValue mainValue: mainValues) { | |
245 mainValue.getPeer(river); | |
246 } | |
239 } | 247 } |
240 | 248 |
241 storeDischargeTable(gauge); | 249 storeDischargeTable(gauge); |
242 storeHistoricalDischargeTable(gauge); | 250 storeHistoricalDischargeTable(gauge); |
243 } | 251 } |