@ThreadSafe public final class PublicSuffixMatcher extends java.lang.Object
An up-to-date list of suffixes can be obtained from publicsuffix.org
PublicSuffixList| Constructor and Description |
|---|
PublicSuffixMatcher(java.util.Collection<PublicSuffixList> lists) |
PublicSuffixMatcher(java.util.Collection<java.lang.String> rules,
java.util.Collection<java.lang.String> exceptions) |
PublicSuffixMatcher(DomainType domainType,
java.util.Collection<java.lang.String> rules,
java.util.Collection<java.lang.String> exceptions) |
| Modifier and Type | Method and Description |
|---|---|
java.lang.String |
getDomainRoot(java.lang.String domain)
Returns registrable part of the domain for the given domain name or
null
if given domain represents a public suffix. |
java.lang.String |
getDomainRoot(java.lang.String domain,
DomainType expectedType)
Returns registrable part of the domain for the given domain name or
null
if given domain represents a public suffix. |
boolean |
matches(java.lang.String domain)
Tests whether the given domain matches any of entry from the public suffix list.
|
boolean |
matches(java.lang.String domain,
DomainType expectedType)
Tests whether the given domain matches any of entry from the public suffix list.
|
public PublicSuffixMatcher(java.util.Collection<java.lang.String> rules,
java.util.Collection<java.lang.String> exceptions)
public PublicSuffixMatcher(DomainType domainType, java.util.Collection<java.lang.String> rules, java.util.Collection<java.lang.String> exceptions)
public PublicSuffixMatcher(java.util.Collection<PublicSuffixList> lists)
public java.lang.String getDomainRoot(java.lang.String domain)
null
if given domain represents a public suffix.domain - public java.lang.String getDomainRoot(java.lang.String domain,
DomainType expectedType)
null
if given domain represents a public suffix.domain - expectedType - expected domain type or null if any.public boolean matches(java.lang.String domain)
public boolean matches(java.lang.String domain,
DomainType expectedType)
domain - expectedType - expected domain type or null if any.true if the given domain matches any of the public suffixes.