com.taursys.servlet.respond
Class StreamResponder

java.lang.Object
  extended bycom.taursys.servlet.respond.AbstractResponder
      extended bycom.taursys.servlet.respond.ContentResponder
          extended bycom.taursys.servlet.respond.StreamResponder
All Implemented Interfaces:
Responder

public class StreamResponder
extends ContentResponder

StreamResponder responds by sending its input stream to the response output stream. The inputStream must be open before the respond method is invoked. The respond method will close the inputStream upon completion. You must reset or re-open the inputStream before this response object can respond again.

Version:
1.0
Author:
Marty Phelan

Constructor Summary
StreamResponder()
          Constructs a new StreamResponder
 
Method Summary
 java.io.InputStream getInputStream()
          Get the inputStream which will be used for the response.
 void respond()
          Responds by sending given input stream to response output stream.
 void setInputStream(java.io.InputStream newInputStream)
          Set the inputStream which will be used for the response.
 
Methods inherited from class com.taursys.servlet.respond.ContentResponder
getContentType, setContentType
 
Methods inherited from class com.taursys.servlet.respond.AbstractResponder
getServletForm, setServletForm
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StreamResponder

public StreamResponder()
Constructs a new StreamResponder

Method Detail

respond

public void respond()
             throws java.lang.Exception
Responds by sending given input stream to response output stream. The inputStream must be open and ready. It will close inputStream upon completion.

Specified by:
respond in interface Responder
Specified by:
respond in class AbstractResponder
Throws:
java.lang.Exception - if problem responding

setInputStream

public void setInputStream(java.io.InputStream newInputStream)
Set the inputStream which will be used for the response. The inputStream must be open and ready. It will be closed by the respond method upon completion.

Parameters:
newInputStream - which will be used for the response.

getInputStream

public java.io.InputStream getInputStream()
Get the inputStream which will be used for the response. The inputStream must be open and ready. It will be closed by the respond method upon completion.

Returns:
inputStream which will be used for the response.


Copyright © 2007 Martin T Phelan. All Rights Reserved.