Search in sources :

Example 11 with DefaultHttpDataFactory

use of org.apache.flink.shaded.netty4.io.netty.handler.codec.http.multipart.DefaultHttpDataFactory in project reactor-netty by reactor.

the class HttpServerFormDecoderProvider method createNewHttpPostRequestDecoder.

ReactorNettyHttpPostRequestDecoder createNewHttpPostRequestDecoder(HttpRequest request, boolean isMultipart, @Nullable Path baseDirectory) {
    DefaultHttpDataFactory factory = maxInMemorySize > 0 ? new DefaultHttpDataFactory(maxInMemorySize, charset) : new DefaultHttpDataFactory(maxInMemorySize == 0, charset);
    factory.setMaxLimit(maxSize);
    if (baseDirectory != null) {
        factory.setBaseDir(baseDirectory.toFile().getAbsolutePath());
    }
    return isMultipart ? new ReactorNettyHttpPostMultipartRequestDecoder(factory, request) : new ReactorNettyHttpPostStandardRequestDecoder(factory, request);
}
Also used : DefaultHttpDataFactory(io.netty.handler.codec.http.multipart.DefaultHttpDataFactory)

Aggregations

DefaultHttpDataFactory (io.netty.handler.codec.http.multipart.DefaultHttpDataFactory)10 HttpDataFactory (io.netty.handler.codec.http.multipart.HttpDataFactory)8 HttpPostRequestEncoder (io.netty.handler.codec.http.multipart.HttpPostRequestEncoder)6 MemoryFileUpload (io.netty.handler.codec.http.multipart.MemoryFileUpload)5 FileUpload (io.netty.handler.codec.http.multipart.FileUpload)4 FullHttpRequest (io.netty.handler.codec.http.FullHttpRequest)2 HttpRequest (io.netty.handler.codec.http.HttpRequest)2 InterfaceHttpData (io.netty.handler.codec.http.multipart.InterfaceHttpData)2 File (java.io.File)2 DefaultHttpRequest (com.github.dreamhead.moco.model.DefaultHttpRequest)1 Bootstrap (io.netty.bootstrap.Bootstrap)1 EventLoopGroup (io.netty.channel.EventLoopGroup)1 NioEventLoopGroup (io.netty.channel.nio.NioEventLoopGroup)1 NioSocketChannel (io.netty.channel.socket.nio.NioSocketChannel)1 DefaultFullHttpRequest (io.netty.handler.codec.http.DefaultFullHttpRequest)1 DefaultHttpRequest (io.netty.handler.codec.http.DefaultHttpRequest)1 HttpMethod (io.netty.handler.codec.http.HttpMethod)1 HttpVersion (io.netty.handler.codec.http.HttpVersion)1 DiskFileUpload (io.netty.handler.codec.http.multipart.DiskFileUpload)1 HttpPostMultipartRequestDecoder (io.netty.handler.codec.http.multipart.HttpPostMultipartRequestDecoder)1