public final class MultipartHttpEntity extends Object implements HttpEntity
Constructor and Description |
---|
MultipartHttpEntity(Collection<HttpPart> parts) |
Modifier and Type | Method and Description |
---|---|
byte[] |
getBytes()
Provides the entity's content as bytes.
|
InputStream |
getContent()
Provides the entity's content as a stream.
|
Optional<Long> |
getLength()
Provides the length (in bytes) of the
HttpEntity , if known. |
Collection<HttpPart> |
getParts()
Provides the entity's content parts.
|
boolean |
isComposed()
Tells whether or not this entity is composed of several parts, in which case they should be available through
HttpEntity.getParts() . |
boolean |
isStreaming()
Tells whether this entity's content is stream based.
|
public MultipartHttpEntity(Collection<HttpPart> parts)
public boolean isStreaming()
HttpEntity
isStreaming
in interface HttpEntity
true
if content is streamed, false
otherwiseHttpEntity.getContent()
public boolean isComposed()
HttpEntity
HttpEntity.getParts()
.isComposed
in interface HttpEntity
true
if there are several content parts, false
otherwisepublic InputStream getContent()
HttpEntity
getContent
in interface HttpEntity
InputStream
representing this entity's content or null
if such representation is not possiblepublic byte[] getBytes()
HttpEntity
getBytes
in interface HttpEntity
null
if such representation is not possiblepublic Collection<HttpPart> getParts()
HttpEntity
getParts
in interface HttpEntity
HttpParts
representing this entity's content parts, if presentHttpEntity.isComposed()
public Optional<Long> getLength()
HttpEntity
HttpEntity
, if known. For the most part, only received entities from HTTP
messages that carried a 'Content-Length' header will return a length.getLength
in interface HttpEntity
Optional
with the length (in bytes) or an empty one if unknownCopyright © 2018. All rights reserved.