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 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

      static ReactiveRequest.Content fromString(String string, String mediaType, Charset charset)
    • 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 each Content.Chunk.

      Parameters:
      publisher - the request content Content.Chunks
      contentType - 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 each Content.Chunk.

      Parameters:
      publisher - the request content Content.Chunks
      mediaType - the request content media type
      charset - the request content charset
      Returns:
      a Content wrapping the given Content.Chunks