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 boolean
private ChannelBuffer
private final HttpHeaders
private HttpVersion
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
DefaultHttpMessage
(HttpVersion version) Creates a new instance. -
Method Summary
Modifier and TypeMethodDescription(package private) void
Returns the content of this message.Returns the protocol version of this message.headers()
Returns the headers of this message.boolean
Returnstrue
if and only if this message does not have any content but theHttpChunk
s, which is generated byHttpMessageDecoder
consecutively, contain the actual content.void
setChunked
(boolean chunked) Sets if this message does not have any content but theHttpChunk
s, which is generated byHttpMessageDecoder
consecutively, contain the actual content.void
setContent
(ChannelBuffer content) Sets the content of this message.void
setProtocolVersion
(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:HttpMessage
Returns the headers of this message.- Specified by:
headers
in interfaceHttpMessage
-
isChunked
public boolean isChunked()Description copied from interface:HttpMessage
Returnstrue
if and only if this message does not have any content but theHttpChunk
s, which is generated byHttpMessageDecoder
consecutively, contain the actual content.Please note that this method will keep returning
true
if the"Transfer-Encoding"
of this message is"chunked"
, even if you attempt to override this property by callingHttpMessage.setChunked(boolean)
withfalse
.- Specified by:
isChunked
in interfaceHttpMessage
-
setChunked
public void setChunked(boolean chunked) Description copied from interface:HttpMessage
Sets if this message does not have any content but theHttpChunk
s, which is generated byHttpMessageDecoder
consecutively, 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 returningtrue
if the"Transfer-Encoding"
of this message is"chunked"
.- Specified by:
setChunked
in interfaceHttpMessage
-
setContent
Description copied from interface:HttpMessage
Sets the content of this message. Ifnull
is specified, the content of this message will be set toChannelBuffers.EMPTY_BUFFER
.- Specified by:
setContent
in interfaceHttpMessage
-
getProtocolVersion
Description copied from interface:HttpMessage
Returns the protocol version of this message.- Specified by:
getProtocolVersion
in interfaceHttpMessage
-
setProtocolVersion
Description copied from interface:HttpMessage
Sets the protocol version of this message.- Specified by:
setProtocolVersion
in interfaceHttpMessage
-
getContent
Description copied from interface:HttpMessage
Returns the content of this message. If there is no content orHttpMessage.isChunked()
returnstrue
, anChannelBuffers.EMPTY_BUFFER
is returned.- Specified by:
getContent
in interfaceHttpMessage
-
toString
-
appendHeaders
-