Class DefaultHttpMessage
java.lang.Object
org.jboss.netty.handler.codec.http.DefaultHttpMessage
- All Implemented Interfaces:
HttpMessage
- Direct Known Subclasses:
DefaultHttpRequest,DefaultHttpResponse
The default
HttpMessage implementation.-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate booleanprivate ChannelBufferprivate final HttpHeadersprivate HttpVersion -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedDefaultHttpMessage(HttpVersion version) Creates a new instance. -
Method Summary
Modifier and TypeMethodDescription(package private) voidReturns the content of this message.Returns the protocol version of this message.headers()Returns the headers of this message.booleanReturnstrueif and only if this message does not have any content but theHttpChunks, which is generated byHttpMessageDecoderconsecutively, contain the actual content.voidsetChunked(boolean chunked) Sets if this message does not have any content but theHttpChunks, which is generated byHttpMessageDecoderconsecutively, contain the actual content.voidsetContent(ChannelBuffer content) Sets the content of this message.voidsetProtocolVersion(HttpVersion version) Sets the protocol version of this message.toString()
-
Field Details
-
headers
-
version
-
-
chunked
private boolean chunked
-
-
Constructor Details
-
DefaultHttpMessage
Creates a new instance.
-
-
Method Details
-
headers
Description copied from interface:HttpMessageReturns the headers of this message.- Specified by:
headersin interfaceHttpMessage
-
isChunked
public boolean isChunked()Description copied from interface:HttpMessageReturnstrueif and only if this message does not have any content but theHttpChunks, which is generated byHttpMessageDecoderconsecutively, contain the actual content.Please note that this method will keep returning
trueif the"Transfer-Encoding"of this message is"chunked", even if you attempt to override this property by callingHttpMessage.setChunked(boolean)withfalse.- Specified by:
isChunkedin interfaceHttpMessage
-
setChunked
public void setChunked(boolean chunked) Description copied from interface:HttpMessageSets if this message does not have any content but theHttpChunks, which is generated byHttpMessageDecoderconsecutively, contain the actual content.If this method is called with
true, the content of this message becomesChannelBuffers.EMPTY_BUFFER.Even if this method is called with
false,HttpMessage.isChunked()will keep returningtrueif the"Transfer-Encoding"of this message is"chunked".- Specified by:
setChunkedin interfaceHttpMessage
-
setContent
Description copied from interface:HttpMessageSets the content of this message. Ifnullis specified, the content of this message will be set toChannelBuffers.EMPTY_BUFFER.- Specified by:
setContentin interfaceHttpMessage
-
getProtocolVersion
Description copied from interface:HttpMessageReturns the protocol version of this message.- Specified by:
getProtocolVersionin interfaceHttpMessage
-
setProtocolVersion
Description copied from interface:HttpMessageSets the protocol version of this message.- Specified by:
setProtocolVersionin interfaceHttpMessage
-
getContent
Description copied from interface:HttpMessageReturns the content of this message. If there is no content orHttpMessage.isChunked()returnstrue, anChannelBuffers.EMPTY_BUFFERis returned.- Specified by:
getContentin interfaceHttpMessage
-
toString
-
appendHeaders
-