Search code examples
guava

Can you load a custom Public Suffix file in Guava?


I'm using Guava's InternetDomainName.from(domain).topPrivateDomain().toString() to extract the "top private domain" from full domain names.

e.g. for bbc.co.uk, it would list .co.uk as the "top private domain", as opposed to simply .uk.

Unfortunately, the list it's based on (the Mozilla Public Suffix List, included in com.google.thirdparty.publicsuffix.PublicSuffixPatterns) is lacking certain commercial TLDs which effectively function as "top private domains".

e.g.: wordpress.com, wix.com

Does Guava offer the option to load an amended list, using Mozilla's original .dat format, which has the additions included, and use that instead of the hard coded one? Thanks!


Solution

  • Sorry, not currently. See this feature request.