Class StringContent
- java.lang.Object
-
- org.eclipse.jetty.reactive.client.internal.AbstractSinglePublisher<ContentChunk>
-
- org.eclipse.jetty.reactive.client.internal.StringContent
-
- All Implemented Interfaces:
ReactiveRequest.Content,org.reactivestreams.Publisher<ContentChunk>,org.reactivestreams.Subscription
public class StringContent extends AbstractSinglePublisher<ContentChunk> implements ReactiveRequest.Content
Utility class that provides a String as reactive content.
-
-
Constructor Summary
Constructors Constructor Description StringContent(java.lang.String string, java.lang.String mediaType, java.nio.charset.Charset encoding)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.StringgetContentType()longgetLength()protected voidonRequest(org.reactivestreams.Subscriber<? super ContentChunk> subscriber, long n)-
Methods inherited from class org.eclipse.jetty.reactive.client.internal.AbstractSinglePublisher
cancel, cappedAdd, isCancelled, onFailure, request, subscribe, subscriber, toString
-
-
-
-
Method Detail
-
getLength
public long getLength()
- Specified by:
getLengthin interfaceReactiveRequest.Content- Returns:
- the content length
-
getContentType
public java.lang.String getContentType()
- Specified by:
getContentTypein interfaceReactiveRequest.Content- Returns:
- the content type in the form
media_type[;charset=<charset>]
-
onRequest
protected void onRequest(org.reactivestreams.Subscriber<? super ContentChunk> subscriber, long n)
- Specified by:
onRequestin classAbstractSinglePublisher<ContentChunk>
-
-