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 String
format(String hostname, int port)
Format an address string intohost:port
or*:port
syntax.static String
format(SocketAddress s, int defaultPort)
Format an address string intohost:port
or*:port
syntax.static String
hostname(InetSocketAddress addr)
Get the name or IP address, or*
if this address is a wildcard IP.static boolean
isIPv6(InetAddress ip)
True if this InetAddress is a raw IPv6 in dotted quad notation.static InetSocketAddress
parse(String desc, int defaultPort)
Parse an address string such ashost:port
or*:port
.static InetSocketAddress
resolve(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:port
or*:port
syntax.
-
format
public static String format(String hostname, int port)
Format an address string intohost:port
or*:port
syntax.
-
parse
public static InetSocketAddress parse(String desc, int defaultPort)
Parse an address string such ashost:port
or*:port
.
-
resolve
public static InetSocketAddress resolve(String desc, int defaultPort)
Parse and resolve an address string, looking up the IP address.
-
-