Mercurial > dive4elements > river
comparison artifacts/src/main/java/org/dive4elements/river/artifacts/states/HWSBarriersState.java @ 5867:59ff03ff48f1
River artifacts: Renamed FLYSArtifact(Collection) to D4EArtifact(Collection).
author | Sascha L. Teichmann <teichmann@intevation.de> |
---|---|
date | Sun, 28 Apr 2013 15:23:01 +0200 |
parents | 73da40528cf2 |
children | af13ceeba52a |
comparison
equal
deleted
inserted
replaced
5866:9a6741ccf6d4 | 5867:59ff03ff48f1 |
---|---|
38 | 38 |
39 import org.dive4elements.artifacts.common.utils.FileTools; | 39 import org.dive4elements.artifacts.common.utils.FileTools; |
40 | 40 |
41 import org.dive4elements.artifacts.common.utils.XMLUtils.ElementCreator; | 41 import org.dive4elements.artifacts.common.utils.XMLUtils.ElementCreator; |
42 | 42 |
43 import org.dive4elements.river.artifacts.FLYSArtifact; | 43 import org.dive4elements.river.artifacts.D4EArtifact; |
44 | 44 |
45 import org.dive4elements.river.artifacts.access.MapAccess; | 45 import org.dive4elements.river.artifacts.access.MapAccess; |
46 | 46 |
47 import org.dive4elements.river.artifacts.model.LayerInfo; | 47 import org.dive4elements.river.artifacts.model.LayerInfo; |
48 | 48 |
72 } | 72 } |
73 | 73 |
74 | 74 |
75 @Override | 75 @Override |
76 protected Element createStaticData( | 76 protected Element createStaticData( |
77 FLYSArtifact flys, | 77 D4EArtifact flys, |
78 ElementCreator creator, | 78 ElementCreator creator, |
79 CallContext cc, | 79 CallContext cc, |
80 String name, | 80 String name, |
81 String value, | 81 String value, |
82 String type | 82 String type |
95 } | 95 } |
96 | 96 |
97 | 97 |
98 @Override | 98 @Override |
99 public Object computeAdvance( | 99 public Object computeAdvance( |
100 FLYSArtifact artifact, | 100 D4EArtifact artifact, |
101 String hash, | 101 String hash, |
102 CallContext context, | 102 CallContext context, |
103 List<Facet> facets, | 103 List<Facet> facets, |
104 Object old | 104 Object old |
105 ) { | 105 ) { |
275 | 275 |
276 FileTools.deleteRecursive(source); | 276 FileTools.deleteRecursive(source); |
277 } | 277 } |
278 | 278 |
279 private void createMapfile( | 279 private void createMapfile( |
280 FLYSArtifact artifact, | 280 D4EArtifact artifact, |
281 File artifactDir, | 281 File artifactDir, |
282 String name, | 282 String name, |
283 String hwsShapefile, | 283 String hwsShapefile, |
284 String type, | 284 String type, |
285 String srid, | 285 String srid, |
315 @Override | 315 @Override |
316 public void endOfLife(Artifact artifact, Object callContext) { | 316 public void endOfLife(Artifact artifact, Object callContext) { |
317 super.endOfLife(artifact, callContext); | 317 super.endOfLife(artifact, callContext); |
318 logger.info("ScenarioSelect.endOfLife: " + artifact.identifier()); | 318 logger.info("ScenarioSelect.endOfLife: " + artifact.identifier()); |
319 | 319 |
320 FLYSArtifact flys = (FLYSArtifact) artifact; | 320 D4EArtifact flys = (D4EArtifact) artifact; |
321 removeDirectory(flys); | 321 removeDirectory(flys); |
322 } | 322 } |
323 | 323 |
324 | 324 |
325 /** | 325 /** |
326 * Removes the directory and all its content where the required data and the | 326 * Removes the directory and all its content where the required data and the |
327 * results of WSPLGEN are stored. Should be called in endOfLife(). | 327 * results of WSPLGEN are stored. Should be called in endOfLife(). |
328 */ | 328 */ |
329 // FIXME: I've seen this code somewhere else... | 329 // FIXME: I've seen this code somewhere else... |
330 protected void removeDirectory(FLYSArtifact artifact) { | 330 protected void removeDirectory(D4EArtifact artifact) { |
331 String shapePath = RiverUtils.getXPathString( | 331 String shapePath = RiverUtils.getXPathString( |
332 RiverUtils.XPATH_FLOODMAP_SHAPEFILE_DIR); | 332 RiverUtils.XPATH_FLOODMAP_SHAPEFILE_DIR); |
333 | 333 |
334 File artifactDir = new File(shapePath, artifact.identifier()); | 334 File artifactDir = new File(shapePath, artifact.identifier()); |
335 | 335 |
351 * | 351 * |
352 * @param artifact The owner Artifact. | 352 * @param artifact The owner Artifact. |
353 * | 353 * |
354 * @return the directory for WSPLEN data. | 354 * @return the directory for WSPLEN data. |
355 */ | 355 */ |
356 protected File getDirectory(FLYSArtifact artifact) { | 356 protected File getDirectory(D4EArtifact artifact) { |
357 String shapePath = RiverUtils.getXPathString( | 357 String shapePath = RiverUtils.getXPathString( |
358 RiverUtils.XPATH_FLOODMAP_SHAPEFILE_DIR); | 358 RiverUtils.XPATH_FLOODMAP_SHAPEFILE_DIR); |
359 | 359 |
360 File artifactDir = FileTools.getDirectory( | 360 File artifactDir = FileTools.getDirectory( |
361 shapePath, artifact.identifier()); | 361 shapePath, artifact.identifier()); |