Package play.http
Class HttpEntity.Streamed
- Object
-
- play.http.HttpEntity
-
- play.http.HttpEntity.Streamed
-
- Enclosing class:
- HttpEntity
public static final class HttpEntity.Streamed extends HttpEntity
A streamed entity, backed by a source.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class play.http.HttpEntity
HttpEntity.Chunked, HttpEntity.Streamed, HttpEntity.Strict
-
-
Field Summary
-
Fields inherited from class play.http.HttpEntity
NO_ENTITY
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description HttpEntity
as(String contentType)
play.api.http.HttpEntity
asScala()
Optional<Long>
contentLength()
Optional<String>
contentType()
Source<ByteString,?>
data()
Source<ByteString,?>
dataStream()
boolean
isKnownEmpty()
-
Methods inherited from class play.http.HttpEntity
chunked, consumeData, fromContent, fromString
-
-
-
-
Method Detail
-
data
public Source<ByteString,?> data()
-
contentType
public Optional<String> contentType()
- Specified by:
contentType
in classHttpEntity
- Returns:
- The content type, if defined
-
isKnownEmpty
public boolean isKnownEmpty()
- Specified by:
isKnownEmpty
in classHttpEntity
- Returns:
- Whether the entity is known to be empty or not.
-
contentLength
public Optional<Long> contentLength()
- Specified by:
contentLength
in classHttpEntity
- Returns:
- The content length, if known
-
as
public HttpEntity as(String contentType)
- Specified by:
as
in classHttpEntity
- Parameters:
contentType
- the content type to use, i.e. "text/html".- Returns:
- Return the entity as the given content type.
-
dataStream
public Source<ByteString,?> dataStream()
- Specified by:
dataStream
in classHttpEntity
- Returns:
- The stream of data.
-
asScala
public play.api.http.HttpEntity asScala()
- Specified by:
asScala
in classHttpEntity
-
-