Class NetUtils


  • public class NetUtils
    extends java.lang.Object
    This class contains common utilities for netstuff. Like printing IPv6 literals correctly
    • Constructor Summary

      Constructors 
      Constructor Description
      NetUtils()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static java.lang.String formatInetAddr​(java.net.InetSocketAddress addr)  
      static java.lang.String[] getIPV6HostAndPort​(java.lang.String hostPort)
      Separates host and port from given host port string if host port string is enclosed within square bracket.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • NetUtils

        public NetUtils()
    • Method Detail

      • formatInetAddr

        public static java.lang.String formatInetAddr​(java.net.InetSocketAddress addr)
      • getIPV6HostAndPort

        public static java.lang.String[] getIPV6HostAndPort​(java.lang.String hostPort)
        Separates host and port from given host port string if host port string is enclosed within square bracket.
        Parameters:
        hostPort - host port string
        Returns:
        String[]{host, port} if host port string is host:port or String[] {host, port:port} if host port string is host:port:port or String[] {host} if host port string is host or String[]{} if not a ipv6 host port string.