Token instances.
| Modifier and Type | Class and Description |
|---|---|
| private class | MultipartParser.
The state of the parser dealing with multipart bodies. |
| public static class | MultipartParser.
Represents a token that contains |
| private static class | MultipartParser.
The state of the parser when finished, either due to seeing the final boundary or to a malformed message. |
| private class | MultipartParser.
The state of the parser dealing with part headers. |
| public static class | MultipartParser.
Represents a token that contains |
| private class | MultipartParser.
The initial state of the parser. |
| private static interface | MultipartParser.
Represents the internal state of the |
| public abstract static class | MultipartParser.
Represents the output of |
| Modifier and Type | Field and Description |
|---|---|
| private final byte[] | |
| private static final byte | |
| private static final byte[] | |
| private static final String | |
| private final Charset | |
| private static final byte | |
| private static final byte | |
| private static final Log | |
| private final int | |
| private final AtomicBoolean | |
| private final FluxSink | |
| private final AtomicReference | |
| private static final byte[] |
| Access | Constructor and Description |
|---|---|
| private | MultipartParser(FluxSink<MultipartParser.
|
| Modifier and Type | Method and Description |
|---|---|
| pack-priv boolean | |
| public Context | currentContext()
Overrides default reactor. Request a |
| pack-priv void | |
| pack-priv void | |
| pack-priv void | |
| pack-priv void | |
| protected void | hookOnComplete()
Overrides reactor. Optional hook for completion processing. |
| protected void | hookOnError(Throwable
the error to process throwable)Overrides reactor. Optional hook for error processing. |
| protected void | hookOnNext(DataBuffer
the emitted value to process value)Overrides reactor. Hook for processing of onNext values. |
| protected void | hookOnSubscribe(Subscription
the subscription to optionally process subscription)Overrides reactor. Hook for further processing of onSubscribe's Subscription. |
| private void | |
| public static Flux | Returns: a stream of parsed tokensthe input buffers buffers, byte[] the multipart boundary, as found in the boundary, int Content-Type headerthe maximum buffered header size maxHeadersSize, Charset the charset to use for decoding headers headersCharset)Parses the given stream of |
| private void |
| boundary | back to summary |
|---|---|
| private final byte[] boundary | |
| CR | back to summary |
|---|---|
| private static final byte CR | |
| CR_LF | back to summary |
|---|---|
| private static final byte[] CR_LF | |
| HEADER_ENTRY_SEPARATOR | back to summary |
|---|---|
| private static final String HEADER_ENTRY_SEPARATOR | |
| headersCharset | back to summary |
|---|---|
| private final Charset headersCharset | |
| HYPHEN | back to summary |
|---|---|
| private static final byte HYPHEN | |
| LF | back to summary |
|---|---|
| private static final byte LF | |
| logger | back to summary |
|---|---|
| private static final Log logger | |
| maxHeadersSize | back to summary |
|---|---|
| private final int maxHeadersSize | |
| requestOutstanding | back to summary |
|---|---|
| private final AtomicBoolean requestOutstanding | |
| sink | back to summary |
|---|---|
| private final FluxSink<MultipartParser. | |
| state | back to summary |
|---|---|
| private final AtomicReference<MultipartParser. | |
| TWO_HYPHENS | back to summary |
|---|---|
| private static final byte[] TWO_HYPHENS | |
| MultipartParser | back to summary |
|---|---|
| private MultipartParser(FluxSink<MultipartParser. | |
| changeState | back to summary |
|---|---|
| pack-priv boolean changeState(MultipartParser. | |
| currentContext | back to summary |
|---|---|
| public Context currentContext() Overrides default reactor. Doc from reactor. Request a
| |
| emitBody | back to summary |
|---|---|
| pack-priv void emitBody(DataBuffer buffer, boolean last) | |
| emitComplete | back to summary |
|---|---|
| pack-priv void emitComplete() | |
| emitError | back to summary |
|---|---|
| pack-priv void emitError(Throwable t) | |
| emitHeaders | back to summary |
|---|---|
| pack-priv void emitHeaders(HttpHeaders headers) | |
| hookOnComplete | back to summary |
|---|---|
| protected void hookOnComplete() Overrides reactor. Doc from reactor. Optional hook for completion processing. Defaults to doing nothing.
| |
| hookOnError | back to summary |
|---|---|
| protected void hookOnError(Throwable throwable) Overrides reactor. Doc from reactor. Optional hook for error processing. Default is to call
| |
| hookOnNext | back to summary |
|---|---|
| protected void hookOnNext(DataBuffer value) Overrides reactor. Doc from reactor. Hook for processing of onNext values. You can call Defaults to doing nothing.
| |
| hookOnSubscribe | back to summary |
|---|---|
| protected void hookOnSubscribe(Subscription subscription) Overrides reactor. Doc from reactor. Hook for further processing of onSubscribe's Subscription. Implement this method
to call Defaults to request unbounded Long.MAX_VALUE as in
| |
| onSinkCancel | back to summary |
|---|---|
| private void onSinkCancel() | |
| parse | back to summary |
|---|---|
| public static Flux Parses the given stream of
| |
| requestBuffer | back to summary |
|---|---|
| private void requestBuffer() | |
BodyToken until the boundary is found (or
rather: CR LF - - boundary).
| Modifier and Type | Field and Description |
|---|---|
| private final DataBufferUtils. | |
| private final int | |
| private final Deque |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public void | |
| private void | |
| private void | |
| public void | |
| public void | onNext(DataBuffer buffer)
Implements org. Checks whether the (end of the) needle |
| public String |
| boundary | back to summary |
|---|---|
| private final DataBufferUtils. | |
| boundaryLength | back to summary |
|---|---|
| private final int boundaryLength | |
| queue | back to summary |
|---|---|
| private final Deque<DataBuffer> queue | |
| BodyState | back to summary |
|---|---|
| public BodyState() | |
| dispose | back to summary |
|---|---|
| public void dispose() Overrides default org.
| |
| enqueue | back to summary |
|---|---|
| private void enqueue(DataBuffer buf) Store the given buffer. Emit buffers that cannot contain boundary bytes, by iterating over the queue in reverse order, and summing buffer sizes. The first buffer that passes the boundary length and subsequent buffers are emitted (in the correct, non-reverse order). | |
| flush | back to summary |
|---|---|
| private void flush() | |
| onComplete | back to summary |
|---|---|
| public void onComplete() Implements org.
| |
| onNext | back to summary |
|---|---|
| public void onNext(DataBuffer buffer) Implements org. Checks whether the (end of the) needle
| |
| toString | back to summary |
|---|---|
| public String toString() Overrides java. Doc from java. Returns a string representation of the object.
Satisfying this method's contract implies a non- | |
DataBuffer.
| Modifier and Type | Field and Description |
|---|---|
| private final DataBuffer | |
| private final boolean |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public DataBuffer | |
| public HttpHeaders | headers()
Implements abstract org.
|
| public boolean |
| buffer | back to summary |
|---|---|
| private final DataBuffer buffer | |
| last | back to summary |
|---|---|
| private final boolean last | |
| BodyToken | back to summary |
|---|---|
| public BodyToken(DataBuffer buffer, boolean last) | |
| buffer | back to summary |
|---|---|
| public DataBuffer buffer() Implements abstract org.
| |
| headers | back to summary |
|---|---|
| public HttpHeaders headers() Implements abstract org.
| |
| isLast | back to summary |
|---|---|
| public boolean isLast() Implements abstract org.
| |
| Modifier and Type | Field and Description |
|---|---|
| public static final MultipartParser. |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public void | |
| public void | |
| public String |
| INSTANCE | back to summary |
|---|---|
| public static final MultipartParser. | |
| DisposedState | back to summary |
|---|---|
| private DisposedState() | |
| onComplete | back to summary |
|---|---|
| public void onComplete() Implements org.
| |
| onNext | back to summary |
|---|---|
| public void onNext(DataBuffer buf) Implements org.
| |
| toString | back to summary |
|---|---|
| public String toString() Overrides java. Doc from java. Returns a string representation of the object.
Satisfying this method's contract implies a non- | |
HttpHeaders instance, making sure that
the amount does not exceed maxHeadersSize.
| Modifier and Type | Field and Description |
|---|---|
| private final List | |
| private final AtomicInteger | |
| private final DataBufferUtils. |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| private boolean | belowMaxHeaderSize(long count)
Checks whether the given |
| public void | |
| private boolean | isLastBoundary(DataBuffer buf)
If the given buffer is the first buffer, check whether it starts with |
| public void | |
| public void | onNext(DataBuffer buf)
Implements org. First checks whether the multipart boundary leading to this state was the final boundary. |
| private HttpHeaders | |
| public String |
| buffers | back to summary |
|---|---|
| private final List<DataBuffer> buffers | |
| byteCount | back to summary |
|---|---|
| private final AtomicInteger byteCount | |
| endHeaders | back to summary |
|---|---|
| private final DataBufferUtils. | |
| HeadersState | back to summary |
|---|---|
| private HeadersState() | |
| belowMaxHeaderSize | back to summary |
|---|---|
| private boolean belowMaxHeaderSize(long count) Checks whether the given | |
| dispose | back to summary |
|---|---|
| public void dispose() Overrides default org.
| |
| isLastBoundary | back to summary |
|---|---|
| private boolean isLastBoundary(DataBuffer buf) If the given buffer is the first buffer, check whether it starts with | |
| onComplete | back to summary |
|---|---|
| public void onComplete() Implements org.
| |
| onNext | back to summary |
|---|---|
| public void onNext(DataBuffer buf) Implements org. First checks whether the multipart boundary leading to this state
was the final boundary. Then looks for the header-body boundary
(
| |
| parseHeaders | back to summary |
|---|---|
| private HttpHeaders parseHeaders() Parses the list of buffers into a | |
| toString | back to summary |
|---|---|
| public String toString() Overrides java. Doc from java. Returns a string representation of the object.
Satisfying this method's contract implies a non- | |
HttpHeaders.
| Modifier and Type | Field and Description |
|---|---|
| private final HttpHeaders |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public DataBuffer | |
| public HttpHeaders | headers()
Implements abstract org.
|
| public boolean |
| headers | back to summary |
|---|---|
| private final HttpHeaders headers | |
| HeadersToken | back to summary |
|---|---|
| public HeadersToken(HttpHeaders headers) | |
| buffer | back to summary |
|---|---|
| public DataBuffer buffer() Implements abstract org.
| |
| headers | back to summary |
|---|---|
| public HttpHeaders headers() Implements abstract org.
| |
| isLast | back to summary |
|---|---|
| public boolean isLast() Implements abstract org.
| |
CR LF; only the prefix -- is required.
| Modifier and Type | Field and Description |
|---|---|
| private final DataBufferUtils. |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public void | |
| public void | onNext(DataBuffer buf)
Implements org. Looks for the first boundary in the given buffer. |
| public String |
| firstBoundary | back to summary |
|---|---|
| private final DataBufferUtils. | |
| PreambleState | back to summary |
|---|---|
| public PreambleState() | |
| onComplete | back to summary |
|---|---|
| public void onComplete() Implements org.
| |
| onNext | back to summary |
|---|---|
| public void onNext(DataBuffer buf) Implements org. Looks for the first boundary in the given buffer. If found, changes
state to
| |
| toString | back to summary |
|---|---|
| public String toString() Overrides java. Doc from java. Returns a string representation of the object.
Satisfying this method's contract implies a non- | |
MultipartParser.
The flow for well-formed multipart messages is shown below:
PREAMBLE
|
v
+-->HEADERS--->DISPOSED
| |
| v
+----BODY
For malformed messages the flow ends in DISPOSED, and also when the
sink is cancelled.
| Modifier and Type | Method and Description |
|---|---|
| public default void | |
| public void | |
| public void |
| dispose | back to summary |
|---|---|
| public default void dispose() | |
| onComplete | back to summary |
|---|---|
| public void onComplete() | |
| onNext | back to summary |
|---|---|
| public void onNext(DataBuffer buf) | |
parse(Flux, byte[], int, Charset).
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public abstract DataBuffer | |
| public abstract HttpHeaders | |
| public abstract boolean |
| Token | back to summary |
|---|---|
| public Token() | |
| buffer | back to summary |
|---|---|
| public abstract DataBuffer buffer() | |
| headers | back to summary |
|---|---|
| public abstract HttpHeaders headers() | |
| isLast | back to summary |
|---|---|
| public abstract boolean isLast() | |