Package org.apache.olingo.server.api
Class ODataResponse
java.lang.Object
org.apache.olingo.server.api.ODataResponse
Response object to carry OData-relevant HTTP information (status code, response headers, and content).
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
Adds a header to the response.void
Adds a header to the response.Get all headers with the according values.Gets the content (body).Gets first header value for a given name.getHeaders
(String name) Gets header value for a given name.int
Gets the status code.void
setContent
(InputStream content) Sets the content (body).void
Set a header to the response.void
setODataContent
(ODataContent result) void
setStatusCode
(int statusCode) Sets the status code.
-
Constructor Details
-
ODataResponse
public ODataResponse()
-
-
Method Details
-
setStatusCode
public void setStatusCode(int statusCode) Sets the status code.- See Also:
-
getStatusCode
public int getStatusCode()Gets the status code.- See Also:
-
setHeader
Set a header to the response.
The header name will be handled as case-insensitive key.
If a header already exists then the header will be replaced by this new value.
- Parameters:
name
- case-insensitive header namevalue
- value for the given header name- See Also:
-
addHeader
Adds a header to the response.
The header name will be handled as case-insensitive key.
If a header already exists then the list of values will just be extended.
- Parameters:
name
- case-insensitive header namevalue
- value for the given header name- See Also:
-
addHeader
Adds a header to the response.
The header name will be handled as case-insensitive key.
If a header already exists then the list of values will just be extended.
- Parameters:
name
- case-insensitive header namevalues
- list of values for the given header name- See Also:
-
getAllHeaders
Get all headers with the according values.- Returns:
- an unmodifiable Map of header names/values
-
getHeaders
Gets header value for a given name.- Parameters:
name
- the header name as a case-insensitive key- Returns:
- the header value(s) or null if not found
-
getHeader
Gets first header value for a given name. If header name is not knownnull
is returned.- Parameters:
name
- the header name as a case-insensitive key- Returns:
- the first header value or null if not found
-
setContent
Sets the content (body).- Parameters:
content
- the content asInputStream
-
getContent
Gets the content (body).- Returns:
- the content as
InputStream
-
setODataContent
-
getODataContent
-