你能在 Guava 中加载自定义 Public 后缀文件吗?
Can you load a custom Public Suffix file in Guava?
我正在使用 Guava 的 InternetDomainName.from(domain).topPrivateDomain().toString()
从完整域名中提取 "top private domain"。
例如
对于 bbc.co.uk
,它将 .co.uk
列为 "top private domain",而不是简单地 .uk
.
不幸的是,它所基于的列表(Mozilla Public 后缀列表,包含在 com.google.thirdparty.publicsuffix.PublicSuffixPatterns
中)缺少某些有效用作 "top private domains".[=19= 的商业 TLD ]
例如:wordpress.com
、wix.com
Guava 是否提供加载修改列表的选项,使用 Mozilla 的原始 .dat
格式,其中包含添加内容,并使用它而不是硬编码的?谢谢!
抱歉,目前没有。参见 this feature request。
我正在使用 Guava 的 InternetDomainName.from(domain).topPrivateDomain().toString()
从完整域名中提取 "top private domain"。
例如
对于 bbc.co.uk
,它将 .co.uk
列为 "top private domain",而不是简单地 .uk
.
不幸的是,它所基于的列表(Mozilla Public 后缀列表,包含在 com.google.thirdparty.publicsuffix.PublicSuffixPatterns
中)缺少某些有效用作 "top private domains".[=19= 的商业 TLD ]
例如:wordpress.com
、wix.com
Guava 是否提供加载修改列表的选项,使用 Mozilla 的原始 .dat
格式,其中包含添加内容,并使用它而不是硬编码的?谢谢!
抱歉,目前没有。参见 this feature request。