Mercurial > dive4elements > river
comparison artifacts/src/main/java/org/dive4elements/river/artifacts/states/HWSBarriersState.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 | e4606eae8ea5 |
children | 0a5239a1e46e |
comparison
equal
deleted
inserted
replaced
8855:d7c005e12af0 | 8856:5e38e2924c07 |
---|---|
107 File shapeLines = new File(artifactDir, HWS_SHAPEFILE_LINES); | 107 File shapeLines = new File(artifactDir, HWS_SHAPEFILE_LINES); |
108 successLines = GeometryUtils.writeShapefile( | 108 successLines = GeometryUtils.writeShapefile( |
109 shapeLines, lineType, collectionLines); | 109 shapeLines, lineType, collectionLines); |
110 } | 110 } |
111 | 111 |
112 FeatureCollection collectionPoints = FeatureCollections.newCollection(); | 112 FeatureCollection collectionPoints = |
113 FeatureCollections.newCollection(); | |
113 SimpleFeatureType pointType = null; | 114 SimpleFeatureType pointType = null; |
114 for (HWS h : selectedPoints) { | 115 for (HWS h : selectedPoints) { |
115 pointType = h.getFeatureType(); | 116 pointType = h.getFeatureType(); |
116 collectionPoints.add(h.getFeature()); | 117 collectionPoints.add(h.getFeature()); |
117 } | 118 } |
179 type = "POINT"; | 180 type = "POINT"; |
180 } | 181 } |
181 FloodMapState.createMapfile( | 182 FloodMapState.createMapfile( |
182 artifact, | 183 artifact, |
183 artifactDir, | 184 artifactDir, |
184 MapfileGenerator.MS_LAYER_PREFIX + FloodMapState.WSPLGEN_USER_RGD, | 185 MapfileGenerator.MS_LAYER_PREFIX |
186 + FloodMapState.WSPLGEN_USER_RGD, | |
185 FloodMapState.WSPLGEN_USER_RGD_SHAPE, | 187 FloodMapState.WSPLGEN_USER_RGD_SHAPE, |
186 type, | 188 type, |
187 epsg, | 189 epsg, |
188 FloodMapState.WSPLGEN_USER_RGD); | 190 FloodMapState.WSPLGEN_USER_RGD); |
189 } | 191 } |
206 moveFiles(tmpDir, dir); | 208 moveFiles(tmpDir, dir); |
207 return true; | 209 return true; |
208 } | 210 } |
209 catch (IOException ioe) { | 211 catch (IOException ioe) { |
210 log.warn("Zip archive " + dir + "/" | 212 log.warn("Zip archive " + dir + "/" |
211 + FloodMapState.WSPLGEN_USER_RGD_ZIP + " could not be extracted."); | 213 + FloodMapState.WSPLGEN_USER_RGD_ZIP |
214 + " could not be extracted."); | |
212 return false; | 215 return false; |
213 } | 216 } |
214 } | 217 } |
215 return false; | 218 return false; |
216 } | 219 } |
236 } | 239 } |
237 else { | 240 else { |
238 return true; | 241 return true; |
239 } | 242 } |
240 try { | 243 try { |
241 FileTools.copyFile(file, new File(target, FloodMapState.WSPLGEN_USER_RGD + "." + suffix)); | 244 FileTools.copyFile( |
245 file, | |
246 new File(target, | |
247 FloodMapState.WSPLGEN_USER_RGD | |
248 + "." + suffix)); | |
242 } | 249 } |
243 catch (IOException ioe) { | 250 catch (IOException ioe) { |
244 log.warn ("Error while copying file " + file.getName()); | 251 log.warn("Error while copying file " + file.getName()); |
245 return true; | 252 return true; |
246 } | 253 } |
247 } | 254 } |
248 return true; | 255 return true; |
249 } | 256 } |
262 removeDirectory(flys); | 269 removeDirectory(flys); |
263 } | 270 } |
264 | 271 |
265 | 272 |
266 /** | 273 /** |
267 * Removes the directory and all its content where the required data and the | 274 * Removes directory and all its content where the required data and the |
268 * results of WSPLGEN are stored. Should be called in endOfLife(). | 275 * results of WSPLGEN are stored. Should be called in endOfLife(). |
269 */ | 276 */ |
270 // FIXME: I've seen this code somewhere else... | 277 // FIXME: I've seen this code somewhere else... |
271 protected void removeDirectory(D4EArtifact artifact) { | 278 protected void removeDirectory(D4EArtifact artifact) { |
272 String shapePath = RiverUtils.getXPathString( | 279 String shapePath = RiverUtils.getXPathString( |