public class DefaultHttpMessage extends Object implements HttpMessage
HttpMessage
implementation.Modifier | Constructor and Description |
---|---|
protected |
DefaultHttpMessage(HttpVersion version)
Creates a new instance.
|
Modifier and Type | Method and Description |
---|---|
void |
addHeader(String name,
Object value)
Deprecated.
|
void |
clearHeaders()
Deprecated.
|
boolean |
containsHeader(String name)
Deprecated.
|
ChannelBuffer |
getContent()
Returns the content of this message.
|
String |
getHeader(String name)
Deprecated.
|
Set<String> |
getHeaderNames()
Deprecated.
|
List<Map.Entry<String,String>> |
getHeaders()
Deprecated.
|
List<String> |
getHeaders(String name)
Deprecated.
|
HttpVersion |
getProtocolVersion()
Returns the protocol version of this message.
|
HttpHeaders |
headers()
Returns the headers of this message.
|
boolean |
isChunked()
Returns
true if and only if this message does not have any
content but the HttpChunk s, which is generated by
HttpMessageDecoder consecutively, contain the actual content. |
void |
removeHeader(String name)
Deprecated.
|
void |
setChunked(boolean chunked)
Sets if this message does not have any content but the
HttpChunk s, which is generated by HttpMessageDecoder
consecutively, contain the actual content. |
void |
setContent(ChannelBuffer content)
Sets the content of this message.
|
void |
setHeader(String name,
Iterable<?> values)
Deprecated.
|
void |
setHeader(String name,
Object value)
Deprecated.
|
void |
setProtocolVersion(HttpVersion version)
Sets the protocol version of this message.
|
String |
toString() |
protected DefaultHttpMessage(HttpVersion version)
public HttpHeaders headers()
HttpMessage
headers
in interface HttpMessage
@Deprecated public void addHeader(String name, Object value)
addHeader
in interface HttpMessage
@Deprecated public void setHeader(String name, Object value)
setHeader
in interface HttpMessage
@Deprecated public void setHeader(String name, Iterable<?> values)
setHeader
in interface HttpMessage
@Deprecated public void removeHeader(String name)
removeHeader
in interface HttpMessage
public boolean isChunked()
HttpMessage
true
if and only if this message does not have any
content but the HttpChunk
s, which is generated by
HttpMessageDecoder
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 calling HttpMessage.setChunked(boolean)
with false
.
isChunked
in interface HttpMessage
public void setChunked(boolean chunked)
HttpMessage
HttpChunk
s, which is generated by HttpMessageDecoder
consecutively, contain the actual content.
If this method is called with true
, the content of this message
becomes ChannelBuffers.EMPTY_BUFFER
.
Even if this method is called with false
, HttpMessage.isChunked()
will keep returning true
if the "Transfer-Encoding"
of
this message is "chunked"
.
setChunked
in interface HttpMessage
@Deprecated public void clearHeaders()
clearHeaders
in interface HttpMessage
public void setContent(ChannelBuffer content)
HttpMessage
null
is specified,
the content of this message will be set to ChannelBuffers.EMPTY_BUFFER
.setContent
in interface HttpMessage
@Deprecated public String getHeader(String name)
getHeader
in interface HttpMessage
@Deprecated public List<String> getHeaders(String name)
getHeaders
in interface HttpMessage
@Deprecated public List<Map.Entry<String,String>> getHeaders()
getHeaders
in interface HttpMessage
@Deprecated public boolean containsHeader(String name)
containsHeader
in interface HttpMessage
@Deprecated public Set<String> getHeaderNames()
HttpMessage
Set
of all header names that this message contains.getHeaderNames
in interface HttpMessage
public HttpVersion getProtocolVersion()
HttpMessage
getProtocolVersion
in interface HttpMessage
public void setProtocolVersion(HttpVersion version)
HttpMessage
setProtocolVersion
in interface HttpMessage
public ChannelBuffer getContent()
HttpMessage
HttpMessage.isChunked()
returns true
, an
ChannelBuffers.EMPTY_BUFFER
is returned.getContent
in interface HttpMessage
Copyright © 2008-2015 The Netty Project. All Rights Reserved.