Package org.apache.http.impl.entity
Class DisallowIdentityContentLengthStrategy
java.lang.Object
org.apache.http.impl.entity.DisallowIdentityContentLengthStrategy
- All Implemented Interfaces:
ContentLengthStrategy
@Contract(threading=IMMUTABLE_CONDITIONAL)
public class DisallowIdentityContentLengthStrategy
extends Object
implements ContentLengthStrategy
Decorator for
ContentLengthStrategy
implementations that disallows the use of
identity transfer encoding.- Since:
- 4.2
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final ContentLengthStrategy
static final DisallowIdentityContentLengthStrategy
Fields inherited from interface org.apache.http.entity.ContentLengthStrategy
CHUNKED, IDENTITY
-
Constructor Summary
ConstructorsConstructorDescriptionDisallowIdentityContentLengthStrategy
(ContentLengthStrategy contentLengthStrategy) -
Method Summary
Modifier and TypeMethodDescriptionlong
determineLength
(HttpMessage message) Returns length of the given message in bytes.
-
Field Details
-
INSTANCE
-
contentLengthStrategy
-
-
Constructor Details
-
DisallowIdentityContentLengthStrategy
-
-
Method Details
-
determineLength
Description copied from interface:ContentLengthStrategy
Returns length of the given message in bytes. The returned value must be a non-negative number,ContentLengthStrategy.IDENTITY
if the end of the message will be delimited by the end of connection, orContentLengthStrategy.CHUNKED
if the message is chunk coded- Specified by:
determineLength
in interfaceContentLengthStrategy
- Parameters:
message
- HTTP message- Returns:
- content length,
ContentLengthStrategy.IDENTITY
, orContentLengthStrategy.CHUNKED
- Throws:
HttpException
- in case of HTTP protocol violation
-