Home / Class/ HttpStaticFileServerInitializer Class — netty Architecture

HttpStaticFileServerInitializer Class — netty Architecture

Architecture documentation for the HttpStaticFileServerInitializer class in HttpStaticFileServerInitializer.java from the netty codebase.

Entity Profile

Dependency Diagram

graph TD
  5be3f155_a246_09f6_5428_fa3064782022["HttpStaticFileServerInitializer"]
  b4d4d934_b8b7_d521_d999_3b2e20dd2188["HttpStaticFileServerInitializer.java"]
  5be3f155_a246_09f6_5428_fa3064782022 -->|defined in| b4d4d934_b8b7_d521_d999_3b2e20dd2188
  717864fa_7d9a_7dca_516e_d81248a32d8a["HttpStaticFileServerInitializer()"]
  5be3f155_a246_09f6_5428_fa3064782022 -->|method| 717864fa_7d9a_7dca_516e_d81248a32d8a
  b9da2ae0_601b_8b3f_927b_974a19bc8c3f["initChannel()"]
  5be3f155_a246_09f6_5428_fa3064782022 -->|method| b9da2ae0_601b_8b3f_927b_974a19bc8c3f

Relationship Graph

Source Code

example/src/main/java/io/netty/example/http/file/HttpStaticFileServerInitializer.java lines 26–45

public class HttpStaticFileServerInitializer extends ChannelInitializer<SocketChannel> {

    private final SslContext sslCtx;

    public HttpStaticFileServerInitializer(SslContext sslCtx) {
        this.sslCtx = sslCtx;
    }

    @Override
    public void initChannel(SocketChannel ch) {
        ChannelPipeline pipeline = ch.pipeline();
        if (sslCtx != null) {
            pipeline.addLast(sslCtx.newHandler(ch.alloc()));
        }
        pipeline.addLast(new HttpServerCodec());
        pipeline.addLast(new HttpObjectAggregator(65536));
        pipeline.addLast(new ChunkedWriteHandler());
        pipeline.addLast(new HttpStaticFileServerHandler());
    }
}

Frequently Asked Questions

What is the HttpStaticFileServerInitializer class?
HttpStaticFileServerInitializer is a class in the netty codebase, defined in example/src/main/java/io/netty/example/http/file/HttpStaticFileServerInitializer.java.
Where is HttpStaticFileServerInitializer defined?
HttpStaticFileServerInitializer is defined in example/src/main/java/io/netty/example/http/file/HttpStaticFileServerInitializer.java at line 26.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free