@Test public void testAddressMatching() { Assert.assertTrue(AddressUtil.matchInterface("fe80::62c5:0:fe05:480a%en0", "fe80::62c5:*:fe05:480a%en0")); Assert.assertTrue(AddressUtil.matchInterface("fe80::62c5:aefb:fe05:480a%en1", "fe80::62c5:0-ffff:fe05:480a")); }
public static boolean matchInterface(final String address, final String interfaceMask) { final AddressMatcher mask; try { mask = getAddressMatcher(interfaceMask); } catch (Exception e) { return false; } return mask.match(address); }
AddressUtil { public static boolean matchInterface(final String address, final String interfaceMask) { final AddressMatcher mask; try { mask = getAddressMatcher(interfaceMask); } catch (Exception e) { return false; } return mask.match(address); } }
AddressUtil { public static boolean matchInterface(final String address, final String interfaceMask) { final AddressMatcher mask; try { mask = getAddressMatcher(interfaceMask); } catch (Exception e) { return false; } return mask.match(address); } private  AddressUtil(); }
AddressUtil { public static boolean matchInterface(final String address, final String interfaceMask) { final AddressMatcher mask; try { mask = getAddressMatcher(interfaceMask); } catch (Exception e) { return false; } return mask.match(address); } private  AddressUtil(); static boolean matchAnyInterface(final String address, final Collection<String> interfaces); static boolean matchInterface(final String address, final String interfaceMask); static AddressHolder getAddressHolder(String address); static AddressHolder getAddressHolder(final String address, int defaultPort); static boolean isIpAddress(String address); static InetAddress fixScopeIdAndGetInetAddress(final InetAddress inetAddress); static Inet6Address getInetAddressFor(final Inet6Address inetAddress, String scope); static Collection<Inet6Address> getPossibleInetAddressesFor(final Inet6Address inet6Address); static Collection<String> getMatchingIpv4Addresses(final AddressMatcher addressMatcher); static AddressMatcher getAddressMatcher(String address); }
AddressUtil { public static boolean matchInterface(final String address, final String interfaceMask) { final AddressMatcher mask; try { mask = getAddressMatcher(interfaceMask); } catch (Exception e) { return false; } return mask.match(address); } private  AddressUtil(); static boolean matchAnyInterface(final String address, final Collection<String> interfaces); static boolean matchInterface(final String address, final String interfaceMask); static AddressHolder getAddressHolder(String address); static AddressHolder getAddressHolder(final String address, int defaultPort); static boolean isIpAddress(String address); static InetAddress fixScopeIdAndGetInetAddress(final InetAddress inetAddress); static Inet6Address getInetAddressFor(final Inet6Address inetAddress, String scope); static Collection<Inet6Address> getPossibleInetAddressesFor(final Inet6Address inet6Address); static Collection<String> getMatchingIpv4Addresses(final AddressMatcher addressMatcher); static AddressMatcher getAddressMatcher(String address);  }