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.ContentfromPublisher(org.reactivestreams.Publisher<org.eclipse.jetty.io.Content.Chunk> publisher, String contentType) Creates a Content from the given Publisher ofContent.Chunks.static ReactiveRequest.ContentfromPublisher(org.reactivestreams.Publisher<org.eclipse.jetty.io.Content.Chunk> publisher, String mediaType, Charset charset) Creates a Content from the given Publisher ofContent.Chunks.static ReactiveRequest.ContentfromString(String string, String mediaType, Charset charset) longMethods 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>]
-
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.Chunks.The implementation will call
Retainable.release()on eachContent.Chunk.- Parameters:
publisher- the request contentContent.ChunkscontentType- the request content type- Returns:
- a Content wrapping the given
Content.Chunks
-
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.Chunks.The implementation will call
Retainable.release()on eachContent.Chunk.- Parameters:
publisher- the request contentContent.ChunksmediaType- the request content media typecharset- the request content charset- Returns:
- a Content wrapping the given
Content.Chunks
-