org.apache.tapestry.util
Class TextStreamResponse

java.lang.Object
  extended by org.apache.tapestry.util.TextStreamResponse
All Implemented Interfaces:
StreamResponse

public class TextStreamResponse
extends Object
implements StreamResponse


Constructor Summary
TextStreamResponse(String contentType, String text)
           
 
Method Summary
 String getContentType()
          Returns the content type to be reported to the client.
 InputStream getStream()
          Returns the stream of bytes to be sent to the client.
 void prepareResponse(Response response)
          Prepare response before it is sent to the client.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TextStreamResponse

public TextStreamResponse(String contentType,
                          String text)
Method Detail

getContentType

public String getContentType()
Description copied from interface: StreamResponse
Returns the content type to be reported to the client.

Specified by:
getContentType in interface StreamResponse

getStream

public InputStream getStream()
                      throws IOException
Description copied from interface: StreamResponse
Returns the stream of bytes to be sent to the client. The stream will be closed when the end of the stream is reached. The provided stream will be wrapped in a BufferedInputStream for efficiency.

Specified by:
getStream in interface StreamResponse
Throws:
IOException

prepareResponse

public void prepareResponse(Response response)
Description copied from interface: StreamResponse
Prepare response before it is sent to the client. This is the place to set any response headers (e.g. content-disposition)

Specified by:
prepareResponse in interface StreamResponse
Parameters:
response - Response that will be sent.


Copyright © 2006-2008 Apache Software Foundation. All Rights Reserved.