Mercurial > dive4elements > gnv-client
diff gnv-artifacts/src/main/java/de/intevation/gnv/state/profile/horizontalcrosssection/HorizontalCrossSectionMeshOutputState.java @ 537:f7f97edf09ba
Solved issue 164 - applied patch of msg 763. Remove directories and shape files of out-dated artifacts.
gnv-artifacts/trunk@635 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Ingo Weinzierl <ingo.weinzierl@intevation.de> |
---|---|
date | Wed, 27 Jan 2010 10:01:37 +0000 |
parents | 44415ae01ddb |
children | b248531fa20b |
line wrap: on
line diff
--- a/gnv-artifacts/src/main/java/de/intevation/gnv/state/profile/horizontalcrosssection/HorizontalCrossSectionMeshOutputState.java Tue Jan 26 18:32:12 2010 +0000 +++ b/gnv-artifacts/src/main/java/de/intevation/gnv/state/profile/horizontalcrosssection/HorizontalCrossSectionMeshOutputState.java Wed Jan 27 10:01:37 2010 +0000 @@ -173,10 +173,7 @@ String outputMode = XMLUtils.xpathString( format, XPATH_OUTPUT_MODE, ArtifactNamespaceContext.INSTANCE); - String mimeType = XMLUtils.xpathString( - format, XPATH_MIME_TYPE, ArtifactNamespaceContext.INSTANCE); - - if (outputMode == null || mimeType == null) { + if (outputMode == null) { throw new StateException("cannot find outputMode or mime"); } @@ -219,10 +216,12 @@ FileUtils.createZipArchive(dir, output); } } - AttributedPoint2ds result = getResult(uuid, callContext); - if (result != null - && (p = writeToShapeFile(uuid, result, callContext)) != null) { - FileUtils.createZipArchive(new File(p), output); + else { + AttributedPoint2ds result = getResult(uuid, callContext); + if (result != null + && (p = writeToShapeFile(uuid, result, callContext)) != null) { + FileUtils.createZipArchive(new File(p), output); + } } } catch (IOException ioe) { @@ -312,18 +311,19 @@ log.error("writing isolines failed"); return null; } - + shapeFilePath = shapeDir.getAbsolutePath(); success = true; + + callContext.afterCall(CallContext.STORE); + + return shapeFilePath; } finally { if (!success && createdDir) { FileUtils.deleteRecursive(shapeDir); - } } - - return shapeFilePath = shapeDir.getAbsolutePath(); } protected AttributedPoint2ds getResult(String uuid, CallContext callContext)