public final class HostnameMatcher extends HostMatcher
Example 1: Accept any www.camptocamp.com url
- !hostnameMatch
host : www.camptocamp.com
Example 2: Accept any www.camptocamp.com url (port == -1 accepts any port)
- !hostnameMatch
host : www.camptocamp.com
port : -1
Example 3: Accept any www.camptocamp.com url on port 80 only
- !hostnameMatch
host : www.camptocamp.com
port : 80
Example 4: Accept www.camptocamp.com 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 /
- !hostnameMatch
host : www.camptocamp.com
pathRegex : /print/.+
pathRegex, port| Constructor and Description |
|---|
HostnameMatcher() |
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(java.lang.Object o) |
int |
hashCode() |
void |
setAllowSubDomains(boolean allowSubDomains)
Set if sub-domains are allowed.
|
void |
setHost(java.lang.String host)
Set the host.
|
java.lang.String |
toString() |
protected java.util.Optional<java.lang.Boolean> |
tryOverrideValidation(MatchInfo matchInfo)
If the subclass has its own checks or if it has a different validation method this method can return a
valid value.
|
void |
validate(java.util.List<java.lang.Throwable> validationErrors,
Configuration configuration)
validate that the configuration was correct.
|
matches, setPathRegex, setPortisReject, setRejectpublic void validate(java.util.List<java.lang.Throwable> validationErrors,
Configuration configuration)
ConfigurationObjectvalidationErrors - a list to add any detected errors to.configuration - the containing configurationprotected java.util.Optional<java.lang.Boolean> tryOverrideValidation(MatchInfo matchInfo)
HostMatchertryOverrideValidation in class HostMatchermatchInfo - the match information to validate.public java.lang.String toString()
toString in class HostMatcherpublic void setHost(java.lang.String host)
host - the hostpublic void setAllowSubDomains(boolean allowSubDomains)
allowSubDomains - true if allowedpublic boolean equals(java.lang.Object o)
equals in class HostMatcherpublic int hashCode()
hashCode in class HostMatcher