# HG changeset patch # User Ingo Weinzierl # Date 1264586497 0 # Node ID f7f97edf09ba116f15690d6cdbaffa8ccc41f2c7 # Parent f1dc3c2f9be73bae591cd0c945c5978acb510d70 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 diff -r f1dc3c2f9be7 -r f7f97edf09ba gnv-artifacts/ChangeLog --- a/gnv-artifacts/ChangeLog Tue Jan 26 18:32:12 2010 +0000 +++ b/gnv-artifacts/ChangeLog Wed Jan 27 10:01:37 2010 +0000 @@ -1,3 +1,13 @@ +2010-01-27 Ingo Weinzierl + + Issue164 + + * src/main/java/de/intevation/gnv/state/profile/horizontalcrosssection/HorizontalCrossSectionMeshOutputState.java: + Applied patch of SLT to remove shape files and directories of out-dated + artifacts. Therefor we need to store the artifact after an 'out' operation + - which is actually a read only operation - explicitly into the artifact + database to keep the directory path. + 2010-01-26 Ingo Weinzierl * src/main/java/de/intevation/gnv/state/timeseries/TimeSeriesOutputState.java: diff -r f1dc3c2f9be7 -r f7f97edf09ba gnv-artifacts/src/main/java/de/intevation/gnv/state/profile/horizontalcrosssection/HorizontalCrossSectionMeshOutputState.java --- 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)