Package org.apache.camel.util
Class HostUtils
- java.lang.Object
-
- org.apache.camel.util.HostUtils
-
-
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()
-
-
-
Method Detail
-
getNetworkInterfaceAddresses
public static Map<String,Set<InetAddress>> getNetworkInterfaceAddresses()
-
getAddresses
public static Set<InetAddress> getAddresses()
Returns aSetofInetAddressthat are non-loopback or mac.
-
getLocalHostName
public static String getLocalHostName() throws UnknownHostException
Returns the local hostname. It loops through the network interfaces and returns the first non loopback hostname- 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- Throws:
UnknownHostException
-
-