Class ImportSupport.ImportResponseWrapper

java.lang.Object
HttpServletResponseWrapper
org.apache.velocity.tools.view.ImportSupport.ImportResponseWrapper
Enclosing class:
ImportSupport

protected static class ImportSupport.ImportResponseWrapper extends HttpServletResponseWrapper
Wraps responses to allow us to retrieve results as Strings.
  • Field Details

    • sw

      private StringWriter sw
      The Writer we convey.
    • bos

      private ByteArrayOutputStream bos
      A buffer, alternatively, to accumulate bytes.
    • isWriterUsed

      private boolean isWriterUsed
      'True' if getWriter() was called; false otherwise.
    • isStreamUsed

      private boolean isStreamUsed
      'True if getOutputStream() was called; false otherwise.
    • status

      private int status
      The HTTP status set by the target.
  • Constructor Details

    • ImportResponseWrapper

      public ImportResponseWrapper(HttpServletResponse response)
      Constructs a new ImportResponseWrapper.
      Parameters:
      response - the response to wrap
  • Method Details

    • getWriter

      public PrintWriter getWriter()
      Returns:
      a Writer designed to buffer the output.
    • getOutputStream

      public ServletOutputStream getOutputStream()
      Returns:
      a ServletOutputStream designed to buffer the output.
    • setContentType

      public void setContentType(String x)
      Has no effect.
    • setLocale

      public void setLocale(Locale x)
      Has no effect.
    • setStatus

      public void setStatus(int status)
      Sets the status of the response
      Parameters:
      status - the status code
    • getStatus

      public int getStatus()
      Returns:
      the status of the response
    • getString

      public String getString() throws UnsupportedEncodingException
      Retrieves the buffered output, using the containing tag's 'charEncoding' attribute, or the tag's default encoding, if necessary.
      Returns:
      the buffered output
      Throws:
      UnsupportedEncodingException - if the encoding is not supported