Package com.luciad.ogc.common
Class TLcdHttpServletResponseWrapper
java.lang.Object
com.luciad.ogc.common.TLcdHttpServletResponseWrapper
- All Implemented Interfaces:
ILcdResponse
A wrapper for
HttpServletResponse objects.-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected jakarta.servlet.http.HttpServletResponseprotected PrintWriter -
Constructor Summary
ConstructorsConstructorDescriptionTLcdHttpServletResponseWrapper(jakarta.servlet.http.HttpServletResponse aHttpServletResponse) Creates a new wrapper object. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddDateHeader(String aName, long aValue) Adds a response header with the given name and date-value.voidAdds a response header with the given name and value.voidaddIntHeader(String aName, int aValue) Adds a response header with the given name and integer value.booleancontainsHeader(String aName) Returns true if the response header with the given name has already been set.voidflush()Flushes all pending data being written for this response.jakarta.servlet.http.HttpServletResponseReturns anOutputStreamto which the server can write its response.Returns aPrintWriterto which the server can write its response.voidsetContentLength(int aContentLength) Specifies the size of the data returned by this response.voidsetContentType(String aContentType) Sets the content type (MIME type) of the response.voidsetDateHeader(String aName, long aValue) Sets a response header with the given name and date-value.voidSets a response header with the given name and value.voidsetIntHeader(String aName, int aValue) Sets a response header with the given name and integer value.voidsetStatus(int aStatus) Sets the HTTP status code for this response.
-
Field Details
-
fHttpServletResponse
protected jakarta.servlet.http.HttpServletResponse fHttpServletResponse -
fWriter
-
-
Constructor Details
-
TLcdHttpServletResponseWrapper
public TLcdHttpServletResponseWrapper(jakarta.servlet.http.HttpServletResponse aHttpServletResponse) Creates a new wrapper object.- Parameters:
aHttpServletResponse- TheHttpServletResponseobject around which to build a wrapper.
-
-
Method Details
-
containsHeader
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
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:
setDateHeaderin interfaceILcdResponse- Parameters:
aName- the name of the header to setaValue- the assigned date value
-
addDateHeader
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 setaValue- the assigned date value
-
setIntHeader
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 setaValue- the assigned integer value
-
addIntHeader
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 setaValue- the assigned integer value
-
setHeader
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 methodcontainsHeader(String)can be used to test for the presence of a header before setting its value.- Specified by:
setHeaderin interfaceILcdResponse- Parameters:
aName- the header nameaValue- the header value
-
addHeader
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 nameaValue- the header value
-
getOutputStream
Description copied from interface:ILcdResponseReturns anOutputStreamto which the server can write its response.- Specified by:
getOutputStreamin interfaceILcdResponse- Returns:
- An
OutputStream - Throws:
IOException- if the output stream cannot be retrieved
-
setContentType
Description copied from interface:ILcdResponseSets the content type (MIME type) of the response.- Specified by:
setContentTypein interfaceILcdResponse- Parameters:
aContentType- A MIME type, e.g. "text/xml".
-
setContentLength
public void setContentLength(int aContentLength) Description copied from interface:ILcdResponseSpecifies the size of the data returned by this response.- Specified by:
setContentLengthin interfaceILcdResponse- Parameters:
aContentLength- The data size of the response.
-
setStatus
public void setStatus(int aStatus) Sets the HTTP status code for this response.- Specified by:
setStatusin interfaceILcdResponse- Parameters:
aStatus- the HTTP status code for this response.
-
getWriter
Description copied from interface:ILcdResponseReturns aPrintWriterto which the server can write its response.- Specified by:
getWriterin interfaceILcdResponse- Returns:
- A
PrintWriter - Throws:
IOException- if thePrintWritercannot be created.
-
flush
Description copied from interface:ILcdResponseFlushes all pending data being written for this response.- Specified by:
flushin interfaceILcdResponse- Throws:
IOException- if the flush operation fails.
-
getHttpServletResponse
public jakarta.servlet.http.HttpServletResponse getHttpServletResponse()
-