@Test public void getLocalHostIp() { }
public static String getLocalHostIp() { InetAddress address; String hostAddress; try { address = InetAddress.getLocalHost(); hostAddress = address.getHostAddress(); if (StringUtil.isEmpty(hostAddress)) { hostAddress = address.toString(); } } catch (UnknownHostException noIpAddrException) { hostAddress = LOCALHOST; } return hostAddress; }
NetworkUtil { public static String getLocalHostIp() { InetAddress address; String hostAddress; try { address = InetAddress.getLocalHost(); hostAddress = address.getHostAddress(); if (StringUtil.isEmpty(hostAddress)) { hostAddress = address.toString(); } } catch (UnknownHostException noIpAddrException) { hostAddress = LOCALHOST; } return hostAddress; } }
NetworkUtil { public static String getLocalHostIp() { InetAddress address; String hostAddress; try { address = InetAddress.getLocalHost(); hostAddress = address.getHostAddress(); if (StringUtil.isEmpty(hostAddress)) { hostAddress = address.toString(); } } catch (UnknownHostException noIpAddrException) { hostAddress = LOCALHOST; } return hostAddress; }  }
NetworkUtil { public static String getLocalHostIp() { InetAddress address; String hostAddress; try { address = InetAddress.getLocalHost(); hostAddress = address.getHostAddress(); if (StringUtil.isEmpty(hostAddress)) { hostAddress = address.toString(); } } catch (UnknownHostException noIpAddrException) { hostAddress = LOCALHOST; } return hostAddress; }  static String getLocalHostname(); static String getLocalHostIp(); }
NetworkUtil { public static String getLocalHostIp() { InetAddress address; String hostAddress; try { address = InetAddress.getLocalHost(); hostAddress = address.getHostAddress(); if (StringUtil.isEmpty(hostAddress)) { hostAddress = address.toString(); } } catch (UnknownHostException noIpAddrException) { hostAddress = LOCALHOST; } return hostAddress; }  static String getLocalHostname(); static String getLocalHostIp(); static final String LOCALHOST; static final String LOCALHOST_IPV6; }