public class IPMatcher
extends java.lang.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(java.lang.String ipSpec)
Construct an IPMatcher that will test for the given IP specification
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
match(java.lang.String ipIn)
Determine whether the given full IP falls within the range this
IPMatcher was initialized with. |
public IPMatcher(java.lang.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(java.lang.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 © 2013 DuraSpace. All Rights Reserved.