- 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 class
MultiPartDecoder.DataChunkPublisher
Inner publisher that publishes the body part asDataChunk
.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static 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(Throwable th)
Drain the upstream data and signal the given error.protected void
drainBoth()
Drain upstream (raw) data and decoded downstream data.protected void
drainLoop()
Drain the upstream data in a loop while the contenders value is positive.void
onComplete()
void
onError(Throwable throwable)
void
onNext(DataChunk chunk)
void
onSubscribe(Flow.Subscription subscription)
void
subscribe(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:
subscribe
in interfaceFlow.Publisher<ReadableBodyPart>
-
onSubscribe
public void onSubscribe(Flow.Subscription subscription)
- Specified by:
onSubscribe
in interfaceFlow.Subscriber<DataChunk>
-
onNext
public void onNext(DataChunk chunk)
- Specified by:
onNext
in interfaceFlow.Subscriber<DataChunk>
-
onError
public void onError(Throwable throwable)
- 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
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.
-
-