java.lang.Object
io.helidon.media.multipart.MultiPartDecoder
- All Implemented Interfaces:
Flow.Processor<DataChunk,,ReadableBodyPart> Flow.Publisher<ReadableBodyPart>,Flow.Subscriber<DataChunk>
Reactive processor that decodes HTTP payload as a stream of
BodyPart.
This implementation is documented here /docs-internal/multipartdecoder.md.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected final classInner publisher that publishes the body part asDataChunk. -
Method Summary
Modifier and TypeMethodDescriptionstatic MultiPartDecodercreate(String boundary, MessageBodyReaderContext context) Create a new multipart decoder.protected voiddrain()Drain the upstream data if the contenders value is positive.protected voidDrain the upstream data and signal the given error.protected voidDrain upstream (raw) data and decoded downstream data.protected voidDrain the upstream data in a loop while the contenders value is positive.voidvoidvoidvoidonSubscribe(Flow.Subscription subscription) voidsubscribe(Flow.Subscriber<? super ReadableBodyPart> subscriber)
-
Method Details
-
create
Create a new multipart decoder.- Parameters:
boundary- boundary delimitercontext- reader context- Returns:
- MultiPartDecoder
-
subscribe
- Specified by:
subscribein interfaceFlow.Publisher<ReadableBodyPart>
-
onSubscribe
- Specified by:
onSubscribein interfaceFlow.Subscriber<DataChunk>
-
onNext
- Specified by:
onNextin interfaceFlow.Subscriber<DataChunk>
-
onError
- Specified by:
onErrorin interfaceFlow.Subscriber<DataChunk>
-
onComplete
public void onComplete()- Specified by:
onCompletein interfaceFlow.Subscriber<DataChunk>
-
drain
protected void drain()Drain the upstream data if the contenders value is positive. -
drainLoop
protected void drainLoop()Drain the upstream data in a loop while the contenders value is positive. -
drain
Drain the upstream data and signal the given error.- Parameters:
th- the error to signal
-
drainBoth
protected void drainBoth()Drain upstream (raw) data and decoded downstream data.
-