Mercurial > dive4elements > river
comparison artifacts/src/main/java/org/dive4elements/river/artifacts/states/ScenarioSelect.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 |
---|---|
13 import org.dive4elements.artifacts.CallContext; | 13 import org.dive4elements.artifacts.CallContext; |
14 import org.dive4elements.artifacts.CallMeta; | 14 import org.dive4elements.artifacts.CallMeta; |
15 import org.dive4elements.artifacts.common.utils.FileTools; | 15 import org.dive4elements.artifacts.common.utils.FileTools; |
16 import org.dive4elements.artifacts.common.utils.XMLUtils; | 16 import org.dive4elements.artifacts.common.utils.XMLUtils; |
17 import org.dive4elements.artifacts.common.utils.XMLUtils.ElementCreator; | 17 import org.dive4elements.artifacts.common.utils.XMLUtils.ElementCreator; |
18 import org.dive4elements.river.artifacts.FLYSArtifact; | 18 import org.dive4elements.river.artifacts.D4EArtifact; |
19 import org.dive4elements.river.artifacts.resources.Resources; | 19 import org.dive4elements.river.artifacts.resources.Resources; |
20 import org.dive4elements.river.utils.RiverUtils; | 20 import org.dive4elements.river.utils.RiverUtils; |
21 | 21 |
22 import java.io.File; | 22 import java.io.File; |
23 | 23 |
73 } | 73 } |
74 | 74 |
75 return scenarios; | 75 return scenarios; |
76 } | 76 } |
77 else { | 77 else { |
78 FLYSArtifact flys = (FLYSArtifact) artifact; | 78 D4EArtifact flys = (D4EArtifact) artifact; |
79 String data = flys.getDataAsString(name); | 79 String data = flys.getDataAsString(name); |
80 | 80 |
81 return new Element[] { createItem( | 81 return new Element[] { createItem( |
82 cr, | 82 cr, |
83 new String[] { | 83 new String[] { |
111 @Override | 111 @Override |
112 public void endOfLife(Artifact artifact, Object callContext) { | 112 public void endOfLife(Artifact artifact, Object callContext) { |
113 super.endOfLife(artifact, callContext); | 113 super.endOfLife(artifact, callContext); |
114 logger.info("ScenarioSelect.endOfLife: " + artifact.identifier()); | 114 logger.info("ScenarioSelect.endOfLife: " + artifact.identifier()); |
115 | 115 |
116 FLYSArtifact flys = (FLYSArtifact) artifact; | 116 D4EArtifact flys = (D4EArtifact) artifact; |
117 removeDirectory(flys); | 117 removeDirectory(flys); |
118 } | 118 } |
119 | 119 |
120 | 120 |
121 /** | 121 /** |
122 * Removes the directory and all its content where the required data and the | 122 * Removes the directory and all its content where the required data and the |
123 * results of WSPLGEN are stored. Should be called in endOfLife(). | 123 * results of WSPLGEN are stored. Should be called in endOfLife(). |
124 */ | 124 */ |
125 // FIXME: I've seen this code somewhere else... | 125 // FIXME: I've seen this code somewhere else... |
126 protected void removeDirectory(FLYSArtifact artifact) { | 126 protected void removeDirectory(D4EArtifact artifact) { |
127 String shapePath = RiverUtils.getXPathString( | 127 String shapePath = RiverUtils.getXPathString( |
128 RiverUtils.XPATH_FLOODMAP_SHAPEFILE_DIR); | 128 RiverUtils.XPATH_FLOODMAP_SHAPEFILE_DIR); |
129 | 129 |
130 File artifactDir = new File(shapePath, artifact.identifier()); | 130 File artifactDir = new File(shapePath, artifact.identifier()); |
131 | 131 |