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
Modifier and TypeClassDescriptionprotected final class
Inner publisher that publishes the body part asDataChunk
. -
Method Summary
Modifier and TypeMethodDescriptionstatic MultiPartDecoder
create
(String boundary, MessageBodyReaderContext context) Create a new multipart decoder.protected void
drain()
Drain the upstream data if the contenders value is positive.protected void
Drain the upstream data and signal the given error.protected void
Drain upstream (raw) data and decoded downstream data.protected void
Drain the upstream data in a loop while the contenders value is positive.void
void
void
void
onSubscribe
(Flow.Subscription subscription) void
subscribe
(Flow.Subscriber<? super ReadableBodyPart> subscriber)
-
Method Details
-
create
Create a new multipart decoder.- Parameters:
boundary
- boundary delimitercontext
- reader context- Returns:
- MultiPartDecoder
-
subscribe
- Specified by:
subscribe
in interfaceFlow.Publisher<ReadableBodyPart>
-
onSubscribe
- Specified by:
onSubscribe
in interfaceFlow.Subscriber<DataChunk>
-
onNext
- Specified by:
onNext
in interfaceFlow.Subscriber<DataChunk>
-
onError
- Specified by:
onError
in interfaceFlow.Subscriber<DataChunk>
-
onComplete
public void onComplete()- Specified by:
onComplete
in 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.
-