Package io.micronaut.http.server.netty
Class FormDataHttpContentProcessor
java.lang.Object
io.micronaut.http.server.netty.FormDataHttpContentProcessor
Decodes MediaType.MULTIPART_FORM_DATA
in a non-blocking manner.
Designed to be used by a single thread
- Since:
- 1.0
- Author:
- Graeme Rocher
-
Field Summary
Modifier and TypeFieldDescriptionprotected final long
protected final HttpServerConfiguration
protected final NettyHttpRequest<?>
protected final AtomicLong
protected final long
-
Constructor Summary
ConstructorDescriptionFormDataHttpContentProcessor
(NettyHttpRequest<?> nettyHttpRequest, HttpServerConfiguration configuration) -
Method Summary
Modifier and TypeMethodDescriptionvoid
add
(io.netty.buffer.ByteBufHolder message, Collection<? super io.netty.handler.codec.http.multipart.InterfaceHttpData> out) void
cancel()
void
complete
(Collection<? super io.netty.handler.codec.http.multipart.InterfaceHttpData> out) protected void
fireExceedsLength
(long receivedLength, long expected, io.netty.buffer.ByteBufHolder message) protected void
onData
(io.netty.buffer.ByteBufHolder message, Collection<? super io.netty.handler.codec.http.multipart.InterfaceHttpData> out)
-
Field Details
-
nettyHttpRequest
-
advertisedLength
protected final long advertisedLength -
requestMaxSize
protected final long requestMaxSize -
receivedLength
-
configuration
-
-
Constructor Details
-
FormDataHttpContentProcessor
public FormDataHttpContentProcessor(NettyHttpRequest<?> nettyHttpRequest, HttpServerConfiguration configuration) - Parameters:
nettyHttpRequest
- TheNettyHttpRequest
configuration
- TheNettyHttpServerConfiguration
-
-
Method Details
-
onData
protected void onData(io.netty.buffer.ByteBufHolder message, Collection<? super io.netty.handler.codec.http.multipart.InterfaceHttpData> out) -
add
public void add(io.netty.buffer.ByteBufHolder message, Collection<? super io.netty.handler.codec.http.multipart.InterfaceHttpData> out) throws Throwable - Throws:
Throwable
-
complete
public void complete(Collection<? super io.netty.handler.codec.http.multipart.InterfaceHttpData> out) throws Throwable - Throws:
Throwable
-
cancel
public void cancel() -
fireExceedsLength
protected void fireExceedsLength(long receivedLength, long expected, io.netty.buffer.ByteBufHolder message) - Parameters:
receivedLength
- The length of the content receivedexpected
- The expected length of the contentmessage
- The message to release
-