# HG changeset patch # User Sascha L. Teichmann # Date 1252752328 0 # Node ID c4d85a8532d1c1f5502cffcfdbe8650de43cefec # Parent 88972c6daa4fa5a6521ce3e2ea5530647e46d9e2 Artifact.out() is now called with an java.io.Outpustream instead of producing bytes. artifacts/trunk@77 c6561f87-3c4e-4783-a992-168aeb5c3f6f diff -r 88972c6daa4f -r c4d85a8532d1 Changelog --- a/Changelog Thu Sep 10 23:16:18 2009 +0000 +++ b/Changelog Sat Sep 12 10:45:28 2009 +0000 @@ -1,3 +1,14 @@ +2009-09-12 Sascha L. Teichmann + + * artifacts/src/main/java/de/intevation/artifacts/Artifact.java(out): + out() is now called with an java.io.Outputstream to place + the output. + + * artifact-database/src/main/java/de/intevation/artifactdatabase/DefaultArtifact.java, + artifact-database/src/main/java/de/intevation/artifactdatabase/Backend.java, + artifact-database/src/main/java/de/intevation/artifactdatabase/rest/OutRepresentation.java: + Adjusted. + 2009-09-11 Sascha L. Teichmann * artifact-database/doc/example-conf/conf.xml: Added diff -r 88972c6daa4f -r c4d85a8532d1 artifact-database/src/main/java/de/intevation/artifactdatabase/Backend.java --- a/artifact-database/src/main/java/de/intevation/artifactdatabase/Backend.java Thu Sep 10 23:16:18 2009 +0000 +++ b/artifact-database/src/main/java/de/intevation/artifactdatabase/Backend.java Sat Sep 12 10:45:28 2009 +0000 @@ -17,6 +17,7 @@ import java.io.ByteArrayOutputStream; import java.io.ObjectOutputStream; import java.io.ObjectInputStream; +import java.io.OutputStream; import java.util.zip.GZIPOutputStream; import java.util.zip.GZIPInputStream; @@ -116,9 +117,15 @@ } } - public byte [] out(Document format, Object context) { + public void out( + Document format, + OutputStream output, + Object context + ) + throws IOException + { try { - return original.out(format, context); + original.out(format, output, context); } finally { touch(this); diff -r 88972c6daa4f -r c4d85a8532d1 artifact-database/src/main/java/de/intevation/artifactdatabase/DefaultArtifact.java --- a/artifact-database/src/main/java/de/intevation/artifactdatabase/DefaultArtifact.java Thu Sep 10 23:16:18 2009 +0000 +++ b/artifact-database/src/main/java/de/intevation/artifactdatabase/DefaultArtifact.java Sat Sep 12 10:45:28 2009 +0000 @@ -7,6 +7,9 @@ import org.apache.log4j.Logger; +import java.io.IOException; +import java.io.OutputStream; + /** * @author Sascha L. Teichmann (sascha.teichmann@intevation.de) */ @@ -40,8 +43,13 @@ return XMLUtils.newDocument(); } - public byte [] out(Document format, Object context) { - return new byte[0]; + public void out( + Document format, + OutputStream out, + Object context + ) + throws IOException + { } public void setup(String identifier, ArtifactFactory factory, Object context) { diff -r 88972c6daa4f -r c4d85a8532d1 artifact-database/src/main/java/de/intevation/artifactdatabase/rest/OutRepresentation.java --- a/artifact-database/src/main/java/de/intevation/artifactdatabase/rest/OutRepresentation.java Thu Sep 10 23:16:18 2009 +0000 +++ b/artifact-database/src/main/java/de/intevation/artifactdatabase/rest/OutRepresentation.java Sat Sep 12 10:45:28 2009 +0000 @@ -34,8 +34,7 @@ } public void write(OutputStream outputStream) throws IOException { - byte [] bytes = artifact.out(document, context); - outputStream.write(bytes); + artifact.out(document, outputStream, context); } } // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8: diff -r 88972c6daa4f -r c4d85a8532d1 artifacts/src/main/java/de/intevation/artifacts/Artifact.java --- a/artifacts/src/main/java/de/intevation/artifacts/Artifact.java Thu Sep 10 23:16:18 2009 +0000 +++ b/artifacts/src/main/java/de/intevation/artifacts/Artifact.java Sat Sep 12 10:45:28 2009 +0000 @@ -3,6 +3,8 @@ import org.w3c.dom.Document; import java.io.Serializable; +import java.io.OutputStream; +import java.io.IOException; /** * Interface of the core component of the artifact system: The artifact. @@ -76,9 +78,12 @@ * Produce output from this artifact. * @param format Specifies the format of the output. * @param context The global context of the runtime system. - * @return a byte representation of the output. */ - public byte [] out(Document format, Object context); + public void out( + Document format, + OutputStream out, + Object context) + throws IOException; /** * When created by a factory this method is called to