Home / Class/ HttpStaticFileServer Class — netty Architecture

HttpStaticFileServer Class — netty Architecture

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

Entity Profile

Dependency Diagram

graph TD
  885a0903_479e_ae6f_81ca_40afa13dd2d1["HttpStaticFileServer"]
  d90a6f02_b4ee_ec7e_bc7b_4e5d18fe3994["HttpStaticFileServer.java"]
  885a0903_479e_ae6f_81ca_40afa13dd2d1 -->|defined in| d90a6f02_b4ee_ec7e_bc7b_4e5d18fe3994
  84948096_cfad_8f5d_517c_f2d313ef3783["main()"]
  885a0903_479e_ae6f_81ca_40afa13dd2d1 -->|method| 84948096_cfad_8f5d_517c_f2d313ef3783

Relationship Graph

Source Code

example/src/main/java/io/netty/example/http/file/HttpStaticFileServer.java lines 29–56

public final class HttpStaticFileServer {

    static final boolean SSL = System.getProperty("ssl") != null;
    static final int PORT = Integer.parseInt(System.getProperty("port", SSL? "8443" : "8080"));

    public static void main(String[] args) throws Exception {
        // Configure SSL.
        final SslContext sslCtx = ServerUtil.buildSslContext();

        EventLoopGroup group = new MultiThreadIoEventLoopGroup(NioIoHandler.newFactory());
        try {
            ServerBootstrap b = new ServerBootstrap();
            b.group(group)
             .channel(NioServerSocketChannel.class)
             .handler(new LoggingHandler(LogLevel.INFO))
             .childHandler(new HttpStaticFileServerInitializer(sslCtx));

            Channel ch = b.bind(PORT).sync().channel();

            System.err.println("Open your web browser and navigate to " +
                    (SSL? "https" : "http") + "://127.0.0.1:" + PORT + '/');

            ch.closeFuture().sync();
        } finally {
            group.shutdownGracefully();
        }
    }
}

Frequently Asked Questions

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

Analyze Your Own Codebase

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

Try Supermodel Free