Interface ReactiveRequest.Content
- All Superinterfaces:
org.reactivestreams.Publisher<org.eclipse.jetty.io.Content.Chunk>
- Enclosing class:
ReactiveRequest
public static interface ReactiveRequest.Content
extends org.reactivestreams.Publisher<org.eclipse.jetty.io.Content.Chunk>
A Publisher of content chunks that also specifies the content length and type.
-
Method Summary
Modifier and TypeMethodDescriptionstatic ReactiveRequest.Content
fromPublisher
(org.reactivestreams.Publisher<org.eclipse.jetty.io.Content.Chunk> publisher, String contentType) Creates a Content from the given Publisher ofContent.Chunk
s.static ReactiveRequest.Content
fromPublisher
(org.reactivestreams.Publisher<org.eclipse.jetty.io.Content.Chunk> publisher, String mediaType, Charset charset) Creates a Content from the given Publisher ofContent.Chunk
s.static ReactiveRequest.Content
fromString
(String string, String mediaType, Charset charset) long
default boolean
rewind()
Rewinds this content, if possible.Methods inherited from interface org.reactivestreams.Publisher
subscribe
-
Method Details
-
getLength
long getLength()- Returns:
- the content length
-
getContentType
String getContentType()- Returns:
- the content type in the form
media_type[;charset=<charset>]
-
rewind
default boolean rewind()Rewinds this content, if possible.
- Returns:
- whether this request content was rewound
-
fromString
-
fromPublisher
static ReactiveRequest.Content fromPublisher(org.reactivestreams.Publisher<org.eclipse.jetty.io.Content.Chunk> publisher, String contentType) Creates a Content from the given Publisher of
Content.Chunk
s.The implementation will call
Retainable.release()
on eachContent.Chunk
.- Parameters:
publisher
- the request contentContent.Chunk
scontentType
- the request content type- Returns:
- a Content wrapping the given
Content.Chunk
s
-
fromPublisher
static ReactiveRequest.Content fromPublisher(org.reactivestreams.Publisher<org.eclipse.jetty.io.Content.Chunk> publisher, String mediaType, Charset charset) Creates a Content from the given Publisher of
Content.Chunk
s.The implementation will call
Retainable.release()
on eachContent.Chunk
.- Parameters:
publisher
- the request contentContent.Chunk
smediaType
- the request content media typecharset
- the request content charset- Returns:
- a Content wrapping the given
Content.Chunk
s
-