java.lang.Object
net.i2p.apache.http.conn.util.PublicSuffixMatcher
Utility class that can test if DNS names match the content of the Public Suffix List.
An up-to-date list of suffixes can be obtained from publicsuffix.org.
- See Also:
Field Summary
Constructor Summary
ConstructorsConstructorDescriptionPublicSuffixMatcher(Collection<String> rules, Collection<String> exceptions) Create public suffix matcher.Method Summary
All MethodsModifier and TypeMethodDescriptiongetDomainRoot(String domain) Returns registrable part of the domain for the given domain name ofnullif given domain represents a public suffix.booleanTest if the given domain is a public suffix, meaning it has no registrable part.
Field Details
rules
exceptions
Constructor Details
PublicSuffixMatcher
Create public suffix matcher.- Parameters:
rules- domain suffix rulesexceptions- domain suffix exceptions
Method Details
getDomainRoot
Returns registrable part of the domain for the given domain name ofnullif given domain represents a public suffix.- Parameters:
domain- the domain name to check- Returns:
- the registrable part of the domain, or null if the name is a public suffix, is null, or starts with a dot
matches
Test if the given domain is a public suffix, meaning it has no registrable part.- Parameters:
domain- the domain name to check, a leading dot is ignored- Returns:
- true if the domain is a public suffix, or is null