Package io.hawt.util

Class Hosts


  • public class Hosts
    extends java.lang.Object
    Copied from Fabric8 v1 io.fabric8.utils.HostUtils
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static java.util.Set<java.net.InetAddress> getAddresses()
      Returns a Set of InetAddress that are non-loopback or mac.
      static java.lang.String getLocalHostName()
      Returns the local hostname.
      static java.lang.String getLocalIp()
      Returns the local IP.
      static java.util.Map<java.lang.String,​java.util.Set<java.net.InetAddress>> getNetworkInterfaceAddresses​(boolean includeLoopback)
      Returns a Set of InetAddress per NetworkInterface as a Map.
      • Methods inherited from class java.lang.Object

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

      • PREFERED_ADDRESS_PROPERTY_NAME

        public static final java.lang.String PREFERED_ADDRESS_PROPERTY_NAME
        See Also:
        Constant Field Values
    • Method Detail

      • getNetworkInterfaceAddresses

        public static java.util.Map<java.lang.String,​java.util.Set<java.net.InetAddress>> getNetworkInterfaceAddresses​(boolean includeLoopback)
        Returns a Set of InetAddress per NetworkInterface as a Map.
      • getAddresses

        public static java.util.Set<java.net.InetAddress> getAddresses()
        Returns a Set of InetAddress that are non-loopback or mac.
      • getLocalHostName

        public static java.lang.String getLocalHostName()
                                                 throws java.net.UnknownHostException
        Returns the local hostname. It loops through the network interfaces and returns the first non loopback address
        Throws:
        java.net.UnknownHostException
      • getLocalIp

        public static java.lang.String getLocalIp()
                                           throws java.net.UnknownHostException
        Returns the local IP. It loops through the network interfaces and returns the first non loopback address
        Throws:
        java.net.UnknownHostException