public class LocalHostMatcher extends InetHostMatcher
Example 1: Accept any localhost url
- localMatch {}
Example 2: Accept any localhost url (port == -1 accepts any port)
- localMatch
port : -1
Example 3: Accept any localhost url on port 80 only
- localMatch
port : 80
Example 4: Accept localhost urls with paths that start with /print/.
If the regular expression give does not start with / then it will be added because all paths start with /
- localMatch
pathRegex : /print/.+
authorizedIPspathRegex, port| Constructor and Description |
|---|
LocalHostMatcher() |
| Modifier and Type | Method and Description |
|---|---|
protected byte[][] |
getAuthorizedIPs(java.net.InetAddress mask)
Get the full list of authorized IP addresses for the provided mask.
|
protected java.net.InetAddress |
getMaskAddress()
Get the mask IP address.
|
java.lang.String |
toString() |
void |
validate(java.util.List<java.lang.Throwable> validationErrors,
Configuration configuration)
validate that the configuration was correct.
|
buildMaskedAuthorizedIPs, equals, hashCode, tryOverrideValidationaccepts, setPathRegex, setPortprotected final byte[][] getAuthorizedIPs(java.net.InetAddress mask)
throws java.net.UnknownHostException,
java.net.SocketException
InetHostMatchergetAuthorizedIPs in class InetHostMatchermask - the mask addressjava.net.UnknownHostExceptionjava.net.SocketExceptionpublic final void validate(java.util.List<java.lang.Throwable> validationErrors,
Configuration configuration)
ConfigurationObjectvalidationErrors - a list to add any detected errors to.configuration - the containing configurationpublic final java.lang.String toString()
toString in class HostMatcherprotected final java.net.InetAddress getMaskAddress()
throws java.net.UnknownHostException
InetHostMatchergetMaskAddress in class InetHostMatcherjava.net.UnknownHostException