org.benow.web.path.page.stream
Class ResultWriterImpl

java.lang.Object
  extended by org.benow.web.path.page.stream.ResultWriterImpl
All Implemented Interfaces:
ResultWriter

public class ResultWriterImpl
extends java.lang.Object
implements ResultWriter

A streamer that streams objects. If object is a Reader or InputStream will be streamed from, if other object will be transformed to xml then streamed.

Author:
andy

Constructor Summary
ResultWriterImpl(java.io.Reader in, java.lang.String fileName, org.benow.java.mime.MimeType contentType)
           
 
Method Summary
 java.lang.String getContentType()
           
 java.lang.String getFilename()
           
 void write(java.io.PrintWriter out, org.w3c.dom.Element streamElem, QueryParams params)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ResultWriterImpl

public ResultWriterImpl(java.io.Reader in,
                        java.lang.String fileName,
                        org.benow.java.mime.MimeType contentType)
                 throws javax.xml.transform.TransformerException
Throws:
javax.xml.transform.TransformerException
Method Detail

write

public void write(java.io.PrintWriter out,
                  org.w3c.dom.Element streamElem,
                  QueryParams params)
           throws WebException,
                  java.io.IOException
Specified by:
write in interface ResultWriter
Parameters:
out - where to stream to
streamElem - input stream element that may hold param for stream procedure
params - params at time of stream
Throws:
WebException - if something goes wrong
java.io.IOException

getFilename

public java.lang.String getFilename()
Specified by:
getFilename in interface ResultWriter
Returns:
the suggested filename for the stream when saved, if exists.

getContentType

public java.lang.String getContentType()
Specified by:
getContentType in interface ResultWriter
Returns:
the content type of the content to be streamed