Class DefaultWebApplicationResponse

    • Field Detail

      • bodyOnly

        protected boolean bodyOnly
        Stores the body only flag.
      • buffer

        protected byte[] buffer
        Stores the buffer.
      • characterEncoding

        protected String characterEncoding
        Stores the character encoding.
      • characterEncodingSet

        protected boolean characterEncodingSet
        Stores if the character encoding has been set manually.
      • committed

        protected boolean committed
        Stores the committed flag.
      • contentLength

        protected long contentLength
        Stores the content length.
      • contentType

        protected String contentType
        Stores the content type.
      • contentTypeSet

        protected boolean contentTypeSet
        Stores if the content type has been set manually.
      • cookies

        protected List<Cookie> cookies
        Stores the cookies.
      • gotOutput

        protected boolean gotOutput
        Stores if we acquired the output stream.
      • gotWriter

        protected boolean gotWriter
        Stores if we acquired the writer.
      • index

        protected int index
        Stores the index.
      • locale

        protected Locale locale
        Stores the locale.
      • writer

        protected PrintWriter writer
        Stores the writer.
      • outputStream

        protected OutputStream outputStream
        Stores the output stream.
      • status

        protected int status
        Stores the status code.
      • statusMessage

        protected String statusMessage
        Stores the status message.
      • webApplication

        protected WebApplication webApplication
        Stores the web application.
    • Constructor Detail

      • DefaultWebApplicationResponse

        public DefaultWebApplicationResponse()
        Constructor.
    • Method Detail

      • addDateHeader

        public void addDateHeader​(String name,
                                  long date)
        Add the date header.
        Specified by:
        addDateHeader in interface HttpServletResponse
        Parameters:
        name - the header name.
        date - the header date value.
      • addIntHeader

        public void addIntHeader​(String name,
                                 int value)
        Add the integer header.
        Specified by:
        addIntHeader in interface HttpServletResponse
        Parameters:
        name - the name of the header.
        value - the value of the header.
      • containsHeader

        public boolean containsHeader​(String name)
        Contains the given header.
        Specified by:
        containsHeader in interface HttpServletResponse
        Parameters:
        name - the header name.
        Returns:
        true if there, false otherwise.
      • getBufferSize

        public int getBufferSize()
        Get the buffer size.
        Specified by:
        getBufferSize in interface ServletResponse
        Returns:
        the buffer size.
      • getContentLength

        public long getContentLength()
        Get the content length.
        Returns:
        the content length.
      • getStatusMessage

        public String getStatusMessage()
        Get the status message.
        Returns:
        the status message.
      • getWebApplication

        public WebApplication getWebApplication()
        Get the web application.
        Returns:
        the web application.
      • isBodyOnly

        public boolean isBodyOnly()
        Is body only.
        Returns:
        true if we are only sending the body, false otherwise.
      • isCommitted

        public boolean isCommitted()
        Is committed.
        Specified by:
        isCommitted in interface ServletResponse
        Returns:
        the committed flag.
      • reset

        public void reset()
        Reset the response.
        Specified by:
        reset in interface ServletResponse
      • sendError

        public void sendError​(int status,
                              String statusMessage)
                       throws IOException
        Send the error.
        Specified by:
        sendError in interface HttpServletResponse
        Parameters:
        status - the status code.
        statusMessage - the message.
        Throws:
        IOException - when an I/O error occurs.
      • setBodyOnly

        public void setBodyOnly​(boolean bodyOnly)
        Set the body only flag.
        Parameters:
        bodyOnly - flag.
      • setBufferSize

        public void setBufferSize​(int bufferSize)
        Set the buffer size.
        Specified by:
        setBufferSize in interface ServletResponse
        Parameters:
        bufferSize - the buffer size.
      • setCharacterEncoding

        public void setCharacterEncoding​(String characterEncoding)
        Set the character encoding.
        Specified by:
        setCharacterEncoding in interface ServletResponse
        Parameters:
        characterEncoding - the character encoding.
      • setCommitted

        public void setCommitted​(boolean committed)
        Set the committed.
        Parameters:
        committed - the committed flag.
      • setContentLength

        public void setContentLength​(int contentLength)
        Set the content length.
        Specified by:
        setContentLength in interface ServletResponse
        Parameters:
        contentLength - the content length.
      • setContentLengthLong

        public void setContentLengthLong​(long contentLength)
        Set the content length.
        Specified by:
        setContentLengthLong in interface ServletResponse
        Parameters:
        contentLength - the content length.
      • setContentType

        public void setContentType​(String type)
        Set the content type.
        Specified by:
        setContentType in interface ServletResponse
        Parameters:
        type - the content type.
      • setDateHeader

        public void setDateHeader​(String name,
                                  long date)
        Set the date header.
        Specified by:
        setDateHeader in interface HttpServletResponse
        Parameters:
        name - the header name.
        date - the date.
      • setIntHeader

        public void setIntHeader​(String name,
                                 int value)
        Set the int header.
        Specified by:
        setIntHeader in interface HttpServletResponse
        Parameters:
        name - the header name.
        value - the header value.
      • setLocale

        public void setLocale​(Locale locale)
        Set the locale.
        Specified by:
        setLocale in interface ServletResponse
        Parameters:
        locale - the locale.
      • setOutputStream

        public void setOutputStream​(ServletOutputStream outputStream)
        Set the output stream.
        Parameters:
        outputStream - the output stream.
      • setStatus

        public void setStatus​(int status)
        Set the status.
        Specified by:
        setStatus in interface HttpServletResponse
        Parameters:
        status - the status code.
      • setStatus

        public void setStatus​(int status,
                              String statusMessage)
        Deprecated.
        Set the status.
        Specified by:
        setStatus in interface HttpServletResponse
        Parameters:
        status - the status.
        statusMessage - the message
      • setWebApplication

        public void setWebApplication​(WebApplication webApplication)
        Set the web application.
        Parameters:
        webApplication - the web application.
      • verifyNotCommitted

        protected void verifyNotCommitted​(String methodName)
        Verify we are not committed.
        Parameters:
        methodName - the method we are checking for.
      • isReady

        public boolean isReady()
        Is the output stream ready?
        Specified by:
        isReady in class ServletOutputStream
        Returns:
        true if it is, false otherwise.
      • write

        public void write​(int integer)
                   throws IOException
        Write the integer.
        Specified by:
        write in class OutputStream
        Parameters:
        integer - the integer.
        Throws:
        IOException - when an I/O error occurs.