Class TLcdHttpServletResponseWrapper

java.lang.Object
com.luciad.ogc.common.TLcdHttpServletResponseWrapper
All Implemented Interfaces:
ILcdResponse

public class TLcdHttpServletResponseWrapper extends Object implements ILcdResponse
A wrapper for HttpServletResponse objects.
  • Field Details

    • fHttpServletResponse

      protected jakarta.servlet.http.HttpServletResponse fHttpServletResponse
    • fWriter

      protected PrintWriter fWriter
  • Constructor Details

    • TLcdHttpServletResponseWrapper

      public TLcdHttpServletResponseWrapper(jakarta.servlet.http.HttpServletResponse aHttpServletResponse)
      Creates a new wrapper object.
      Parameters:
      aHttpServletResponse - The HttpServletResponse object around which to build a wrapper.
  • Method Details

    • containsHeader

      public boolean containsHeader(String aName)
      Returns true if the response header with the given name has already been set.
      Parameters:
      aName - the header name
      Returns:
      true if the response header with the given name has already been set
    • setDateHeader

      public void setDateHeader(String aName, long aValue)
      Sets a response header with the given name and date-value. The date is specified in terms of milliseconds since the epoch. If the header had already been set, the new value overwrites the previous one. The containsHeader method can be used to test for the presence of a header before setting its value.
      Specified by:
      setDateHeader in interface ILcdResponse
      Parameters:
      aName - the name of the header to set
      aValue - the assigned date value
    • addDateHeader

      public void addDateHeader(String aName, long aValue)
      Adds a response header with the given name and date-value. The date is specified in terms of milliseconds since the epoch. This method allows response headers to have multiple values.
      Parameters:
      aName - the name of the header to set
      aValue - the assigned date value
    • setIntHeader

      public void setIntHeader(String aName, int aValue)
      Sets a response header with the given name and integer value. If the header had already been set, the new value overwrites the previous one. The containsHeader method can be used to test for the presence of a header before setting its value.
      Parameters:
      aName - the name of the header to set
      aValue - the assigned integer value
    • addIntHeader

      public void addIntHeader(String aName, int aValue)
      Adds a response header with the given name and integer value. This method allows response headers to have multiple values.
      Parameters:
      aName - the name of the header to set
      aValue - the assigned integer value
    • setHeader

      public void setHeader(String aName, String aValue)
      Sets a response header with the given name and value. If the header had already been set, the new value overwrites the previous one. The method containsHeader(String) can be used to test for the presence of a header before setting its value.
      Specified by:
      setHeader in interface ILcdResponse
      Parameters:
      aName - the header name
      aValue - the header value
    • addHeader

      public void addHeader(String aName, String aValue)
      Adds a response header with the given name and value. Multiple values can be registered for one header, by invoking this method multiple times for that header.
      Parameters:
      aName - the header name
      aValue - the header value
    • getOutputStream

      public OutputStream getOutputStream() throws IOException
      Description copied from interface: ILcdResponse
      Returns an OutputStream to which the server can write its response.
      Specified by:
      getOutputStream in interface ILcdResponse
      Returns:
      An OutputStream
      Throws:
      IOException - if the output stream cannot be retrieved
    • setContentType

      public void setContentType(String aContentType)
      Description copied from interface: ILcdResponse
      Sets the content type (MIME type) of the response.
      Specified by:
      setContentType in interface ILcdResponse
      Parameters:
      aContentType - A MIME type, e.g. "text/xml".
    • setContentLength

      public void setContentLength(int aContentLength)
      Description copied from interface: ILcdResponse
      Specifies the size of the data returned by this response.
      Specified by:
      setContentLength in interface ILcdResponse
      Parameters:
      aContentLength - The data size of the response.
    • setStatus

      public void setStatus(int aStatus)
      Sets the HTTP status code for this response.
      Specified by:
      setStatus in interface ILcdResponse
      Parameters:
      aStatus - the HTTP status code for this response.
    • getWriter

      public PrintWriter getWriter() throws IOException
      Description copied from interface: ILcdResponse
      Returns a PrintWriter to which the server can write its response.
      Specified by:
      getWriter in interface ILcdResponse
      Returns:
      A PrintWriter
      Throws:
      IOException - if the PrintWriter cannot be created.
    • flush

      public void flush() throws IOException
      Description copied from interface: ILcdResponse
      Flushes all pending data being written for this response.
      Specified by:
      flush in interface ILcdResponse
      Throws:
      IOException - if the flush operation fails.
    • getHttpServletResponse

      public jakarta.servlet.http.HttpServletResponse getHttpServletResponse()