comparison artifact-database/src/main/java/de/intevation/artifactdatabase/rest/OutRepresentation.java @ 88:69c84cf7c5d7

Added javadoc to the REST package of the artifact database (complete). artifacts/trunk@840 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Sascha L. Teichmann <sascha.teichmann@intevation.de>
date Fri, 26 Mar 2010 15:05:11 +0000
parents 48d1a9a082c2
children e27cf9c84eb8
comparison
equal deleted inserted replaced
87:0f48188a6e02 88:69c84cf7c5d7
8 8
9 import java.io.IOException; 9 import java.io.IOException;
10 import java.io.OutputStream; 10 import java.io.OutputStream;
11 11
12 /** 12 /**
13 * Special representation to serve the out()-outputs
14 * via DeferredOutput efficently .
13 * @author <a href="mailto:sascha.teichmann@intevation">Sascha L. Teichmann</a> 15 * @author <a href="mailto:sascha.teichmann@intevation">Sascha L. Teichmann</a>
14 */ 16 */
15 public class OutRepresentation 17 public class OutRepresentation
16 extends OutputRepresentation 18 extends OutputRepresentation
17 { 19 {
20 /**
21 * The deferred output fetched from ArtifactDatabase.out().
22 */
18 protected DeferredOutput out; 23 protected DeferredOutput out;
19 24
25 /**
26 * Constructor to create representation with a given MIME type and
27 * a deferred output.
28 * @param mediaType The MIME type of this representation.
29 * @param out The deferred output from the ArtifactDatabase.out() call.
30 */
20 public OutRepresentation(MediaType mediaType, DeferredOutput out) { 31 public OutRepresentation(MediaType mediaType, DeferredOutput out) {
21 super(mediaType); 32 super(mediaType);
22 this.out = out; 33 this.out = out;
23 } 34 }
24 35
36 /**
37 * Overwrites the write(OutputStream) of OutRepresentation to serve
38 * the data from the deferred output.
39 * @param output the stream where to write the data into.
40 * @throws IOException Thrown if an exception occurred while writing
41 * the data to the output stream.
42 */
25 public void write(OutputStream output) throws IOException { 43 public void write(OutputStream output) throws IOException {
26 out.write(output); 44 out.write(output);
27 } 45 }
28 } 46 }
29 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8: 47 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :

http://dive4elements.wald.intevation.org