Package org.serviceconnector.web.netty
Class NettyWebResponse
java.lang.Object
org.serviceconnector.web.netty.NettyWebResponse
- All Implemented Interfaces:
IWebResponse
The Class NettyWebResponse.
-
Constructor Summary
ConstructorsConstructorDescriptionNettyWebResponse(io.netty.handler.codec.http.FullHttpResponse httpResponse) Instantiates a new netty web response. -
Method Summary
Modifier and TypeMethodDescriptionvoidAdds the header.byte[]getBytes()Gets the bytes.Gets the output stream.booleanChecks if is redirect.voidRedirect.voidsetContentType(String contentType) Sets the content type.
-
Constructor Details
-
NettyWebResponse
public NettyWebResponse(io.netty.handler.codec.http.FullHttpResponse httpResponse) Instantiates a new netty web response.- Parameters:
httpResponse- the response
-
-
Method Details
-
addHeader
Adds the header.- Specified by:
addHeaderin interfaceIWebResponse- Parameters:
name- the namevalue- the value
-
getOutputStream
Gets the output stream.- Specified by:
getOutputStreamin interfaceIWebResponse- Returns:
- the output stream
-
getBytes
public byte[] getBytes()Gets the bytes.- Specified by:
getBytesin interfaceIWebResponse- Returns:
- the bytes
-
setContentType
Sets the content type.- Specified by:
setContentTypein interfaceIWebResponse- Parameters:
contentType- the new content type
-
redirect
Description copied from interface:IWebResponseRedirect.- Specified by:
redirectin interfaceIWebResponse- Parameters:
path- the path
-
isRedirect
public boolean isRedirect()Description copied from interface:IWebResponseChecks if is redirect.- Specified by:
isRedirectin interfaceIWebResponse- Returns:
- true, if is redirect
-