- java.lang.Object
-
- io.helidon.media.multipart.MultiPartDecoder
-
- All Implemented Interfaces:
Flow.Processor<DataChunk,ReadableBodyPart>,Flow.Publisher<ReadableBodyPart>,Flow.Subscriber<DataChunk>
public class MultiPartDecoder extends Object implements Flow.Processor<DataChunk,ReadableBodyPart>
Reactive processor that decodes HTTP payload as a stream ofBodyPart. This implementation is documented here/docs-internal/multipartdecoder.md.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected classMultiPartDecoder.DataChunkPublisherInner publisher that publishes the body part asDataChunk.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static MultiPartDecodercreate(String boundary, MessageBodyReaderContext context)Create a new multipart decoder.protected voiddrain()Drain the upstream data if the contenders value is positive.protected voiddrain(Throwable th)Drain the upstream data and signal the given error.protected voiddrainBoth()Drain upstream (raw) data and decoded downstream data.protected voiddrainLoop()Drain the upstream data in a loop while the contenders value is positive.voidonComplete()voidonError(Throwable throwable)voidonNext(DataChunk chunk)voidonSubscribe(Flow.Subscription subscription)voidsubscribe(Flow.Subscriber<? super ReadableBodyPart> subscriber)
-
-
-
Method Detail
-
create
public static MultiPartDecoder create(String boundary, MessageBodyReaderContext context)
Create a new multipart decoder.- Parameters:
boundary- boundary delimitercontext- reader context- Returns:
- MultiPartDecoder
-
subscribe
public void subscribe(Flow.Subscriber<? super ReadableBodyPart> subscriber)
- Specified by:
subscribein interfaceFlow.Publisher<ReadableBodyPart>
-
onSubscribe
public void onSubscribe(Flow.Subscription subscription)
- Specified by:
onSubscribein interfaceFlow.Subscriber<DataChunk>
-
onNext
public void onNext(DataChunk chunk)
- Specified by:
onNextin interfaceFlow.Subscriber<DataChunk>
-
onError
public void onError(Throwable throwable)
- 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
protected void drain(Throwable th)
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.
-
-