public class IPMatcher extends Object
IPMatcher is initialized with a particular IP range specification.
Calls to match method will then quickly
determine whether a given IP falls within that range.
Supported range specifications are:
12.34.56.782001:18e8:3:171:218:8bff:fe2a:56a412.34 (which matches any IP starting
12.34)18.25.0.0/255.255.0.018.25.0.0/16,
2001:18e8:3:171::/64| Constructor and Description |
|---|
IPMatcher(String ipSpec)
Construct an IPMatcher that will test for the given IP specification
|
public IPMatcher(String ipSpec) throws IPMatcherException
ipSpec - IP specification (full or partial address, network/netmask,
network/cidr)IPMatcherException - if there is an error parsing the specification (i.e. it is
somehow malformed)public boolean match(String ipIn) throws IPMatcherException
IPMatcher was initialized with.ipIn - IP address as dot-delimited Stringtrue if the IP matches the range of this
IPMatcher; false otherwiseIPMatcherException - if the IP passed in cannot be parsed correctly (i.e. is
malformed)Copyright © 2016 DuraSpace. All rights reserved.