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(String string, String mediaType, Charset encoding)
-
Method Summary
Modifier and Type Method Description String
getContentType()
long
getLength()
protected void
onRequest(org.reactivestreams.Subscriber<? super ContentChunk> subscriber, long n)
Methods inherited from class org.eclipse.jetty.reactive.client.internal.AbstractSinglePublisher
cancel, isCancelled, onFailure, request, subscribe, subscriber, toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.reactivestreams.Publisher
subscribe
-
Constructor Details
-
StringContent
-
-
Method Details
-
getLength
public long getLength()- Specified by:
getLength
in interfaceReactiveRequest.Content
- Returns:
- the content length
-
getContentType
- Specified by:
getContentType
in interfaceReactiveRequest.Content
- Returns:
- the content type in the form
media_type[;charset=<charset>]
-
onRequest
- Specified by:
onRequest
in classAbstractSinglePublisher<ContentChunk>
-