HttpMessageReader for parsing "multipart/form-data"
requests to a stream of Parts.
In default, non-streaming mode, this message reader stores the
contents of parts smaller than
maxInMemorySize in memory, and parts larger
than that to a temporary file in
fileStorageDirectory.
This reader can be provided to MultipartHttpMessageReader in order
to aggregate all parts into a Map.
| Modifier and Type | Field and Description |
|---|---|
| private Scheduler | |
| private FileStorage | |
| private Charset | |
| private long | |
| private int | |
| private int | |
| private int |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public boolean | canRead(ResolvableType
the type of object to check elementType, MediaType the media type for the read (possibly mediaType)null)Implements org. |
| private Scheduler | |
| public int | |
| public List | getReadableMediaTypes()
Implements org. |
| public Flux | read(ResolvableType
the type of objects in the stream which must have been
previously checked via elementType, ReactiveHttpInputMessage canRead(ResolvableType, MediaType)the message to read from message, Map<String, Object> additional information about how to read and decode the input hints)Implements org. |
| public Mono | readMono(ResolvableType
the type of objects in the stream which must have been
previously checked via elementType, ReactiveHttpInputMessage canRead(ResolvableType, MediaType)the message to read from message, Map<String, Object> additional information about how to read and decode the input hints)Implements org. |
| public void | setBlockingOperationScheduler(Scheduler blockingOperationScheduler)
Set the Reactor |
| public void | setFileStorageDirectory(Path fileStorageDirectory)
Set the directory used to store parts larger than
|
| public void | setHeadersCharset(Charset
the charset to use for decoding headers headersCharset)Set the character set used to decode headers. |
| public void | setMaxDiskUsagePerPart(long maxDiskUsagePerPart)
Configure the maximum amount of disk space allowed for file parts. |
| public void | setMaxHeadersSize(int
the maximum amount of memory for headers byteCount)Configure the maximum amount of memory that is allowed per headers section of each part. |
| public void | setMaxInMemorySize(int
the in-memory limit in bytes; if set to -1 the entire
contents will be stored in memory maxInMemorySize)Configure the maximum amount of memory allowed per part. |
| public void | |
| private boolean |
| blockingOperationScheduler | back to summary |
|---|---|
| private Scheduler blockingOperationScheduler | |
| fileStorage | back to summary |
|---|---|
| private FileStorage fileStorage | |
| headersCharset | back to summary |
|---|---|
| private Charset headersCharset | |
| maxDiskUsagePerPart | back to summary |
|---|---|
| private long maxDiskUsagePerPart | |
| maxHeadersSize | back to summary |
|---|---|
| private int maxHeadersSize | |
| maxInMemorySize | back to summary |
|---|---|
| private int maxInMemorySize | |
| maxParts | back to summary |
|---|---|
| private int maxParts | |
| DefaultPartHttpMessageReader | back to summary |
|---|---|
| public DefaultPartHttpMessageReader() | |
| canRead | back to summary |
|---|---|
| public boolean canRead(ResolvableType elementType, MediaType mediaType) Implements org. Doc from org. Whether the given object type is supported by this reader.
| |
| getBlockingOperationScheduler | back to summary |
|---|---|
| private Scheduler getBlockingOperationScheduler() | |
| getMaxInMemorySize | back to summary |
|---|---|
| public int getMaxInMemorySize() Get the | |
| getReadableMediaTypes | back to summary |
|---|---|
| public List Implements org. Doc from org. Return the list of media types supported by this reader. The list may not
apply to every possible target element type and calls to this method
should typically be guarded via | |
| read | back to summary |
|---|---|
| public Flux Implements org. Doc from org. Read from the input message and decode to a stream of objects.
| |
| readMono | back to summary |
|---|---|
| public Mono Implements org. Doc from org. Read from the input message and decode to a single object.
| |
| setBlockingOperationScheduler | back to summary |
|---|---|
| public void setBlockingOperationScheduler(Scheduler blockingOperationScheduler) Set the Reactor Note that this property is ignored when
| |
| setFileStorageDirectory | back to summary |
|---|---|
| public void setFileStorageDirectory(Path fileStorageDirectory) throws IOException Set the directory used to store parts larger than
Note that this property is ignored when
| |
| setHeadersCharset | back to summary |
|---|---|
| public void setHeadersCharset(Charset headersCharset) Set the character set used to decode headers. Defaults to UTF-8 as per RFC 7578.
| |
| setMaxDiskUsagePerPart | back to summary |
|---|---|
| public void setMaxDiskUsagePerPart(long maxDiskUsagePerPart) Configure the maximum amount of disk space allowed for file parts. By default this is set to -1, meaning that there is no maximum. Note that this property is ignored when
| |
| setMaxHeadersSize | back to summary |
|---|---|
| public void setMaxHeadersSize(int byteCount) Configure the maximum amount of memory that is allowed per headers section of each part. When the limit
| |
| setMaxInMemorySize | back to summary |
|---|---|
| public void setMaxInMemorySize(int maxInMemorySize) Configure the maximum amount of memory allowed per part. When the limit is exceeded:
By default this is set to 256K.
| |
| setMaxParts | back to summary |
|---|---|
| public void setMaxParts(int maxParts) Specify the maximum number of parts allowed in a given multipart request. By default this is set to -1, meaning that there is no maximum. | |
| tooManyParts | back to summary |
|---|---|
| private boolean tooManyParts(AtomicInteger partCount) | |