Top Description Inners Fields Constructors Methods
org.springframework.http.codec.multipart

pack-priv final Class PartGenerator

extends BaseSubscriber<MultipartParser.Token>
Class Inheritance
Imports
java.io.IOException, .UncheckedIOException, java.nio.ByteBuffer, java.nio.channels.WritableByteChannel, java.nio.charset.Charset, java.nio.file.Files, .Path, .StandardOpenOption, java.util.ArrayList, .Collection, .List, .Queue, java.util.concurrent.ConcurrentLinkedQueue, java.util.concurrent.atomic.AtomicBoolean, .AtomicLong, .AtomicReference, org.apache.commons.logging.Log, .LogFactory, org.reactivestreams.Subscription, reactor.core.publisher.BaseSubscriber, .Flux, .Mono, .MonoSink, reactor.core.scheduler.Scheduler, reactor.util.context.Context, org.springframework.core.io.buffer.DataBuffer, .DataBufferLimitException, .DataBufferUtils, .DefaultDataBufferFactory, org.springframework.http.HttpHeaders, org.springframework.util.FastByteArrayOutputStream

Subscribes to a token stream (i.e. the result of MultipartParser#parse(Flux, byte[], int, Charset)), and produces a flux of Part objects.
Author
Arjen Poutsma
Since
5.3

Nested and Inner Type Summary

Modifier and TypeClass and Description
private class
PartGenerator.CreateFileState

The creator state when waiting for a temporary file to be created.

private static class
private class
PartGenerator.FormFieldState

The creator state when a form field is received.

private class
private class
PartGenerator.InitialState

The initial state of the creator.

private class
PartGenerator.InMemoryState

The creator state when not handling a form field.

private static interface
PartGenerator.State

Represents the internal state of the PartGenerator for creating a single Part.

private class

Field Summary

Modifier and TypeField and Description
private final Scheduler
private final Mono<Path>
private static final Log
private final long
private final int
private final AtomicBoolean
private final MonoSink<Part>
private final AtomicReference<PartGenerator.State>

Constructor Summary

AccessConstructor and Description
private
PartGenerator(MonoSink<Part> sink, int maxInMemorySize, long maxDiskUsagePerPart, Mono<Path> fileStorageDirectory, Scheduler blockingOperationScheduler)

Method Summary

Modifier and TypeMethod and Description
pack-priv boolean
private void
public static Mono<Part>
createPart(Flux<MultipartParser.Token> tokens, int maxInMemorySize, long maxDiskUsagePerPart, Mono<Path> fileStorageDirectory, Scheduler blockingOperationScheduler)

Creates parts from a given stream of tokens.

public Context
currentContext()

Overrides default reactor.core.CoreSubscriber.currentContext.

Request a Context from dependent components which can include downstream operators during subscribing or a terminal org.reactivestreams.Subscriber.
public void
pack-priv void
pack-priv void
emitPart(Part part)

protected void
hookOnComplete()

Overrides reactor.core.publisher.BaseSubscriber.hookOnComplete.

Optional hook for completion processing.
protected void
hookOnError(Throwable
the error to process
throwable
)

Overrides reactor.core.publisher.BaseSubscriber.hookOnError.

Optional hook for error processing.
protected void
hookOnNext(MultipartParser.Token
the emitted value to process
token
)

Overrides reactor.core.publisher.BaseSubscriber.hookOnNext.

Hook for processing of onNext values.
protected void
hookOnSubscribe(Subscription
the subscription to optionally process
subscription
)

Overrides reactor.core.publisher.BaseSubscriber.hookOnSubscribe.

Hook for further processing of onSubscribe's Subscription.
private void
newPart(PartGenerator.State currentState, HttpHeaders headers)

pack-priv void
Inherited from reactor.core.publisher.BaseSubscriber:
cancelhookFinallyhookOnCancelisDisposedonCompleteonErroronNextonSubscriberequestrequestUnboundedtoStringupstream