Class Suffixes
java.lang.Object
org.miaixz.bus.http.metric.suffix.Suffixes
A database of public suffixes provided by publicsuffix.org.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic Suffixesget()getEffectiveTldPlusOne(String domain) Returns the effective top-level domain plus one (eTLD+1) by referencing the public suffix list.
-
Field Details
-
PUBLIC_SUFFIX_RESOURCE
- See Also:
-
-
Constructor Details
-
Suffixes
public Suffixes()
-
-
Method Details
-
get
-
getEffectiveTldPlusOne
Returns the effective top-level domain plus one (eTLD+1) by referencing the public suffix list. Returns null if the domain is a public suffix or a private address.Here are some examples:
assertEquals("google.com", getEffectiveTldPlusOne("google.com")); assertEquals("google.com", getEffectiveTldPlusOne("www.google.com")); assertNull(getEffectiveTldPlusOne("com")); assertNull(getEffectiveTldPlusOne("localhost")); assertNull(getEffectiveTldPlusOne("mymacbook"));- Parameters:
domain- A canonicalized domain. An International Domain Name (IDN) should be punycode encoded.
-