@Test public void isLocalAddress_localhost() throws Exception { assertThat(AddressUtils.isLocalAddress("localhost"), is(true)); assertThat(AddressUtils.isLocalAddress("127.0.0.1"), is(true)); }
public static boolean isLocalAddress(final String address) throws UnknownHostException { final InetAddress inetAddress = InetAddress.getByName(address); return inetAddress.isLinkLocalAddress() || inetAddress.isAnyLocalAddress() || inetAddress.isLoopbackAddress(); }
AddressUtils { public static boolean isLocalAddress(final String address) throws UnknownHostException { final InetAddress inetAddress = InetAddress.getByName(address); return inetAddress.isLinkLocalAddress() || inetAddress.isAnyLocalAddress() || inetAddress.isLoopbackAddress(); } }
AddressUtils { public static boolean isLocalAddress(final String address) throws UnknownHostException { final InetAddress inetAddress = InetAddress.getByName(address); return inetAddress.isLinkLocalAddress() || inetAddress.isAnyLocalAddress() || inetAddress.isLoopbackAddress(); }  }
AddressUtils { public static boolean isLocalAddress(final String address) throws UnknownHostException { final InetAddress inetAddress = InetAddress.getByName(address); return inetAddress.isLinkLocalAddress() || inetAddress.isAnyLocalAddress() || inetAddress.isLoopbackAddress(); }  static boolean isLocalAddress(final String address); static boolean isPublicAddress(final String address); }
AddressUtils { public static boolean isLocalAddress(final String address) throws UnknownHostException { final InetAddress inetAddress = InetAddress.getByName(address); return inetAddress.isLinkLocalAddress() || inetAddress.isAnyLocalAddress() || inetAddress.isLoopbackAddress(); }  static boolean isLocalAddress(final String address); static boolean isPublicAddress(final String address);  }