Interface MediaPublisher

  • All Superinterfaces:
    Flow.Publisher<io.helidon.common.http.DataChunk>

    public interface MediaPublisher
    extends Flow.Publisher<io.helidon.common.http.DataChunk>
    Represents a publisher of specific media type.
    • Method Detail

      • mediaType

        io.helidon.common.http.MediaType mediaType()
        Returns a media type of published data.
        Returns:
        a published media type or null for undefined.
      • create

        static MediaPublisher create​(io.helidon.common.http.MediaType publishedType,
                                     Flow.Publisher<io.helidon.common.http.DataChunk> publisher)
        Creates new instance.
        Parameters:
        publishedType - a published media type.
        publisher - a publisher.
        Returns:
        new instance.
      • create

        static MediaPublisher create​(io.helidon.common.http.MediaType publishedType,
                                     CharSequence charSequence)
        Creates a publisher of single string.
        Parameters:
        publishedType - a type. If contains charset then it is used, otherwise use UTF-8. If null then text/plain is used as a default.
        charSequence - A sequence to publish.
        Returns:
        new publisher.