Class TextStreamResponse

    • Constructor Summary

      Constructors 
      Constructor Description
      TextStreamResponse​(java.lang.String contentType, java.lang.String text)
      Constructor that defaults the character set to "utf-8".
      TextStreamResponse​(java.lang.String contentType, java.lang.String charset, java.lang.String text)
      Constructor allowing the content type and character set to the specified.
      TextStreamResponse​(ContentType contentType, java.lang.String text)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.String getContentType()
      Returns the content type to be reported to the client.
      java.io.InputStream getStream()
      Converts the text to a byte array (as per the character set, which is usually "UTF-8"), and returns a stream for that byte array.
      void prepareResponse​(Response response)
      Does nothing; subclasses may override.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • TextStreamResponse

        public TextStreamResponse​(java.lang.String contentType,
                                  java.lang.String text)
        Constructor that defaults the character set to "utf-8".
      • TextStreamResponse

        public TextStreamResponse​(java.lang.String contentType,
                                  java.lang.String charset,
                                  java.lang.String text)
        Constructor allowing the content type and character set to the specified.
        Parameters:
        contentType - type of content, often "text/xml"
        charset - character set of output, usually "UTF-8"
        text - text to be streamed in the response
        See Also:
        TapestryHttpSymbolConstants.CHARSET
    • Method Detail

      • getStream

        public java.io.InputStream getStream()
                                      throws java.io.IOException
        Converts the text to a byte array (as per the character set, which is usually "UTF-8"), and returns a stream for that byte array.
        Specified by:
        getStream in interface StreamResponse
        Returns:
        the text as a byte array stram
        Throws:
        java.io.IOException