Package com.luciad.ogc.common
Interface ILcdResponse
- All Known Implementing Classes:
TLcdHttpServletResponseWrapper
public interface ILcdResponse
An interface for server responses.
This interface must not be implemented by users. It may be subject to change.
-
Method Summary
Modifier and TypeMethodDescriptionvoid
flush()
Flushes all pending data being written for this response.Returns anOutputStream
to which the server can write its response.Returns aPrintWriter
to which the server can write its response.void
setContentLength
(int aContentLength) Specifies the size of the data returned by this response.void
setContentType
(String aContentType) Sets the content type (MIME type) of the response.void
setDateHeader
(String aName, long aValue) Sets a response header with the given name and date-value.void
Sets a response header with the given name and value.void
setStatus
(int aStatus) Sets the HTTP status code for this response.
-
Method Details
-
getOutputStream
Returns anOutputStream
to which the server can write its response.- Returns:
- An
OutputStream
- Throws:
IOException
- if the output stream cannot be retrieved
-
getWriter
Returns aPrintWriter
to which the server can write its response.- Returns:
- A
PrintWriter
- Throws:
IOException
- if thePrintWriter
cannot be created.
-
setContentType
Sets the content type (MIME type) of the response.- Parameters:
aContentType
- A MIME type, e.g. "text/xml".
-
setContentLength
void setContentLength(int aContentLength) Specifies the size of the data returned by this response.- Parameters:
aContentLength
- The data size of the response.
-
flush
Flushes all pending data being written for this response.- Throws:
IOException
- if the flush operation fails.
-
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.- Parameters:
aName
- the name of the header to setaValue
- the assigned date value- Since:
- 2017.0
-
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.- Parameters:
aName
- the header nameaValue
- the header value- Since:
- 2017.0
-
setStatus
void setStatus(int aStatus) Sets the HTTP status code for this response.- Parameters:
aStatus
- the HTTP status code for this response.- Since:
- 2017.0
-