Home / Function/ String() — netty Function Reference

String() — netty Function Reference

Architecture documentation for the String() function in HttpUtil.java from the netty codebase.

Entity Profile

Dependency Diagram

graph TD
  e35e5d86_8269_8a00_c9e0_6f4d4033c581["String()"]
  0b1cc975_2772_c898_b055_3991b4e80dba["HttpUtil"]
  e35e5d86_8269_8a00_c9e0_6f4d4033c581 -->|defined in| 0b1cc975_2772_c898_b055_3991b4e80dba
  style e35e5d86_8269_8a00_c9e0_6f4d4033c581 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

codec-http/src/main/java/io/netty/handler/codec/http/HttpUtil.java lines 586–599

    public static String formatHostnameForHttp(InetSocketAddress addr) {
        String hostString = NetUtil.getHostname(addr);
        if (NetUtil.isValidIpV6Address(hostString)) {
            if (!addr.isUnresolved()) {
                hostString = NetUtil.toAddressString(addr.getAddress());
            } else if (hostString.charAt(0) == '[' && hostString.charAt(hostString.length() - 1) == ']') {
                // If IPv6 address already contains brackets, let's return as is.
                return hostString;
            }

            return '[' + hostString + ']';
        }
        return hostString;
    }

Subdomains

Frequently Asked Questions

What does String() do?
String() is a function in the netty codebase, defined in codec-http/src/main/java/io/netty/handler/codec/http/HttpUtil.java.
Where is String() defined?
String() is defined in codec-http/src/main/java/io/netty/handler/codec/http/HttpUtil.java at line 586.

Analyze Your Own Codebase

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

Try Supermodel Free