Mercurial > dive4elements > river
comparison backend/src/main/java/org/dive4elements/river/importer/Importer.java @ 8856:5e38e2924c07 3.2.x
Fix code style.
author | Tom Gottfried <tom@intevation.de> |
---|---|
date | Thu, 18 Jan 2018 20:12:01 +0100 |
parents | 3ecf1f76b2b8 |
children | da5dc7446652 0a5239a1e46e |
comparison
equal
deleted
inserted
replaced
8855:d7c005e12af0 | 8856:5e38e2924c07 |
---|---|
141 | 141 |
142 for (String gew: args) { | 142 for (String gew: args) { |
143 log.info("parsing info gew file: " + gew); | 143 log.info("parsing info gew file: " + gew); |
144 File gewFile = new File(gew); | 144 File gewFile = new File(gew); |
145 if (bwastrFile == null) { | 145 if (bwastrFile == null) { |
146 bwastrFile = new File(gewFile.getParentFile(), BWASTR_ID_CSV_FILE); | 146 bwastrFile = new File( |
147 gewFile.getParentFile(), BWASTR_ID_CSV_FILE); | |
147 } | 148 } |
148 try { | 149 try { |
149 infoGewParser.parse(gewFile); | 150 infoGewParser.parse(gewFile); |
150 } | 151 } |
151 catch (IOException ioe) { | 152 catch (IOException ioe) { |
157 String gew = Config.INSTANCE.getInfoGewFile(); | 158 String gew = Config.INSTANCE.getInfoGewFile(); |
158 if (gew != null && gew.length() > 0) { | 159 if (gew != null && gew.length() > 0) { |
159 log.info("parsing info gew file: " + gew); | 160 log.info("parsing info gew file: " + gew); |
160 File gewFile = new File(gew); | 161 File gewFile = new File(gew); |
161 if (bwastrFile == null) { | 162 if (bwastrFile == null) { |
162 bwastrFile = new File(gewFile.getParentFile(), BWASTR_ID_CSV_FILE); | 163 bwastrFile = new File( |
164 gewFile.getParentFile(), BWASTR_ID_CSV_FILE); | |
163 } | 165 } |
164 try { | 166 try { |
165 infoGewParser.parse(gewFile); | 167 infoGewParser.parse(gewFile); |
166 } | 168 } |
167 catch (IOException ioe) { | 169 catch (IOException ioe) { |
181 HashMap<String,Long> map = bwastrIdParser.getMap(); | 183 HashMap<String,Long> map = bwastrIdParser.getMap(); |
182 | 184 |
183 // Now link rivers with official numbers. | 185 // Now link rivers with official numbers. |
184 for(ImportRiver river: infoGewParser.getRivers()) { | 186 for(ImportRiver river: infoGewParser.getRivers()) { |
185 for(Map.Entry<String, Long> entry: map.entrySet()) { | 187 for(Map.Entry<String, Long> entry: map.entrySet()) { |
186 if (StringUtil.containsIgnoreCase(river.getName(), entry.getKey())) { | 188 if (StringUtil.containsIgnoreCase( |
189 river.getName(), entry.getKey())) { | |
187 river.setOfficialNumber(entry.getValue()); | 190 river.setOfficialNumber(entry.getValue()); |
188 log.debug(river.getName() + " is mapped to bwastr " + entry.getValue()); | 191 log.debug(river.getName() |
192 + " is mapped to bwastr " + entry.getValue()); | |
189 } | 193 } |
190 } | 194 } |
191 } | 195 } |
192 } catch (IOException ioe) { | 196 } catch (IOException ioe) { |
193 log.warn("BWASTR-file could not be loaded."); | 197 log.warn("BWASTR-file could not be loaded."); |