Package io.hawt.util
Class Hosts
- java.lang.Object
-
- io.hawt.util.Hosts
-
public class Hosts extends Object
Copied from Fabric8 v1 io.fabric8.utils.HostUtils
-
-
Field Summary
Fields Modifier and Type Field Description static StringPREFERED_ADDRESS_PROPERTY_NAME
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static Set<InetAddress>getAddresses()Returns aSetofInetAddressthat are non-loopback or mac.static StringgetLocalHostName()Returns the local hostname.static StringgetLocalIp()Returns the local IP.static Map<String,Set<InetAddress>>getNetworkInterfaceAddresses(boolean includeLoopback)
-
-
-
Field Detail
-
PREFERED_ADDRESS_PROPERTY_NAME
public static final String PREFERED_ADDRESS_PROPERTY_NAME
- See Also:
- Constant Field Values
-
-
Method Detail
-
getNetworkInterfaceAddresses
public static Map<String,Set<InetAddress>> getNetworkInterfaceAddresses(boolean includeLoopback)
- Returns:
-
getAddresses
public static Set<InetAddress> getAddresses()
Returns aSetofInetAddressthat are non-loopback or mac.- Returns:
-
getLocalHostName
public static String getLocalHostName() throws UnknownHostException
Returns the local hostname. It loops through the network interfaces and returns the first non loopback address- Returns:
- Throws:
UnknownHostException
-
getLocalIp
public static String getLocalIp() throws UnknownHostException
Returns the local IP. It loops through the network interfaces and returns the first non loopback address- Returns:
- Throws:
UnknownHostException
-
-