Package com.google.gerrit.server.util
Class SocketUtil
- java.lang.Object
-
- com.google.gerrit.server.util.SocketUtil
-
public final class SocketUtil extends Object
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static Stringformat(String hostname, int port)Format an address string intohost:portor*:portsyntax.static Stringformat(SocketAddress s, int defaultPort)Format an address string intohost:portor*:portsyntax.static Stringhostname(InetSocketAddress addr)Get the name or IP address, or*if this address is a wildcard IP.static booleanisIPv6(InetAddress ip)True if this InetAddress is a raw IPv6 in dotted quad notation.static InetSocketAddressparse(String desc, int defaultPort)Parse an address string such ashost:portor*:port.static InetSocketAddressresolve(String desc, int defaultPort)Parse and resolve an address string, looking up the IP address.
-
-
-
Method Detail
-
isIPv6
public static boolean isIPv6(InetAddress ip)
True if this InetAddress is a raw IPv6 in dotted quad notation.
-
hostname
public static String hostname(InetSocketAddress addr)
Get the name or IP address, or*if this address is a wildcard IP.
-
format
public static String format(SocketAddress s, int defaultPort)
Format an address string intohost:portor*:portsyntax.
-
format
public static String format(String hostname, int port)
Format an address string intohost:portor*:portsyntax.
-
parse
public static InetSocketAddress parse(String desc, int defaultPort)
Parse an address string such ashost:portor*:port.
-
resolve
public static InetSocketAddress resolve(String desc, int defaultPort)
Parse and resolve an address string, looking up the IP address.
-
-