public static final class HttpEntity.Chunked extends java.lang.Object implements HttpEntity.Chunked, RequestEntity, scala.Product, scala.Serializable
Transfer-Encoding: chunked
).HttpEntity.Chunk, HttpEntity.Chunk$, HttpEntity.Chunked, HttpEntity.Chunked$, HttpEntity.ChunkStreamPart, HttpEntity.ChunkStreamPart$, HttpEntity.CloseDelimited, HttpEntity.CloseDelimited$, HttpEntity.Default, HttpEntity.Default$, HttpEntity.DiscardedEntity, HttpEntity.HttpEntityScalaDSLSugar, HttpEntity.HttpEntityScalaDSLSugar$, HttpEntity.IndefiniteLength, HttpEntity.IndefiniteLength$, HttpEntity.LastChunk, HttpEntity.LastChunk$, HttpEntity.Strict, HttpEntity.Strict$, HttpEntity.WithoutKnownLength
EMPTY
Constructor and Description |
---|
Chunked(ContentType contentType,
akka.stream.scaladsl.Source<HttpEntity.ChunkStreamPart,java.lang.Object> chunks) |
Modifier and Type | Method and Description |
---|---|
akka.stream.scaladsl.Source<HttpEntity.ChunkStreamPart,java.lang.Object> |
chunks() |
scala.Option<java.lang.Object> |
contentLengthOption()
Some(content length) if a length is defined for this entity, None otherwise.
|
ContentType |
contentType()
The
ContentType associated with this entity. |
akka.stream.scaladsl.Source<akka.util.ByteString,java.lang.Object> |
dataBytes()
A stream of the data of this entity.
|
akka.stream.javadsl.Source<HttpEntity.ChunkStreamPart,java.lang.Object> |
getChunks()
Java API
|
boolean |
isChunked()
Returns if this entity is a subtype of HttpEntityChunked.
|
boolean |
isKnownEmpty()
Returns if this entity is known to be empty.
|
java.lang.String |
productPrefix() |
java.lang.String |
toString() |
HttpEntity.Chunked |
transformDataBytes(akka.stream.scaladsl.Flow<akka.util.ByteString,akka.util.ByteString,java.lang.Object> transformer)
Returns a copy of the given entity with the ByteString chunks of this entity transformed by the given transformer.
|
HttpEntity.Chunked |
withContentType(ContentType contentType)
Creates a copy of this HttpEntity with the
contentType overridden with the given one. |
HttpEntity.Chunked |
withoutSizeLimit()
Lift the size limit from this entity by returning a new entity instance which skips the size verification.
|
HttpEntity.Chunked |
withSizeLimit(long maxBytes)
Apply the given size limit to this entity by returning a new entity instance which automatically verifies that the
data stream encapsulated by this instance produces at most `maxBytes` data bytes.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
completionStageCovariant, discardBytes, getContentLengthOption, getContentType, getDataBytes, isCloseDelimited, isDefault, isIndefiniteLength, toStrict, toStrict, toStrict, toStrict, withContentType
public Chunked(ContentType contentType, akka.stream.scaladsl.Source<HttpEntity.ChunkStreamPart,java.lang.Object> chunks)
public ContentType contentType()
HttpEntity
ContentType
associated with this entity.public akka.stream.scaladsl.Source<HttpEntity.ChunkStreamPart,java.lang.Object> chunks()
public boolean isKnownEmpty()
HttpEntity
isKnownEmpty
in interface HttpEntity
public scala.Option<java.lang.Object> contentLengthOption()
HttpEntity
In many cases it's dangerous to rely on the (non-)existence of a content-length. HTTP intermediaries like (transparent) proxies are allowed to change the transfer-encoding which can result in the entity being delivered as another type as expected.
public boolean isChunked()
HttpEntity
isChunked
in interface HttpEntity
public akka.stream.scaladsl.Source<akka.util.ByteString,java.lang.Object> dataBytes()
HttpEntity
public HttpEntity.Chunked withSizeLimit(long maxBytes)
HttpEntity
withSizeLimit
in interface HttpEntity
maxBytes
- (undocumented)public HttpEntity.Chunked withoutSizeLimit()
HttpEntity
withoutSizeLimit
in interface HttpEntity
public HttpEntity.Chunked transformDataBytes(akka.stream.scaladsl.Flow<akka.util.ByteString,akka.util.ByteString,java.lang.Object> transformer)
HttpEntity
Chunked
entity, the chunks will be transformed one by one keeping the chunk metadata (but may introduce an
extra chunk before the LastChunk
if transformer.onTermination
returns additional data).
This method may only throw an exception if the transformer
function throws an exception while creating the transformer.
Any other errors are reported through the new entity data stream.
transformer
- (undocumented)public HttpEntity.Chunked withContentType(ContentType contentType)
HttpEntity
contentType
overridden with the given one.contentType
- (undocumented)public java.lang.String productPrefix()
productPrefix
in interface scala.Product
public java.lang.String toString()
toString
in class java.lang.Object
public akka.stream.javadsl.Source<HttpEntity.ChunkStreamPart,java.lang.Object> getChunks()
getChunks
in interface HttpEntity.Chunked