private static class ResponseBodyEmitterReturnValueHandler.StreamingServletServerHttpResponse extends java.lang.Object implements ServerHttpResponse
Modifier and Type | Field and Description |
---|---|
private ServerHttpResponse |
delegate |
private HttpHeaders |
mutableHeaders |
Constructor and Description |
---|
StreamingServletServerHttpResponse(ServerHttpResponse delegate) |
Modifier and Type | Method and Description |
---|---|
void |
close()
Close this response, freeing any resources created.
|
void |
flush()
Ensure that the headers and the content of the response are written out.
|
java.io.OutputStream |
getBody()
Return the body of the message as an output stream.
|
HttpHeaders |
getHeaders()
Return the headers of this message.
|
void |
setStatusCode(HttpStatus status)
Set the HTTP status code of the response.
|
private final ServerHttpResponse delegate
private final HttpHeaders mutableHeaders
public StreamingServletServerHttpResponse(ServerHttpResponse delegate)
public void setStatusCode(HttpStatus status)
ServerHttpResponse
setStatusCode
in interface ServerHttpResponse
status
- the HTTP status as an HttpStatus enum valuepublic HttpHeaders getHeaders()
HttpMessage
getHeaders
in interface HttpMessage
null
)public java.io.OutputStream getBody() throws java.io.IOException
HttpOutputMessage
getBody
in interface HttpOutputMessage
null
)java.io.IOException
- in case of I/O Errorspublic void flush() throws java.io.IOException
ServerHttpResponse
After the first flush, headers can no longer be changed. Only further content writing and content flushing is possible.
flush
in interface java.io.Flushable
flush
in interface ServerHttpResponse
java.io.IOException
public void close()
ServerHttpResponse
close
in interface java.io.Closeable
close
in interface java.lang.AutoCloseable
close
in interface ServerHttpResponse