public class EffectiveTldFinder extends Object
EffectiveTldFinder.getInstance()
.initialize(InputStream)
.
Updates to the public suffix list can be found here:
EffectiveTldFinder.getInstance()
.initialize(true)
or
.initialize(InputStream, true)
. This will exclude the PRIVATE domain section
from the public suffix list.Modifier and Type | Class and Description |
---|---|
static class |
EffectiveTldFinder.EffectiveTLD |
Modifier and Type | Field and Description |
---|---|
static String |
COMMENT |
static char |
DOT |
static String |
DOT_REGEX |
static String |
ETLD_DATA |
static String |
EXCEPTION |
static String |
WILD_CARD |
Modifier and Type | Method and Description |
---|---|
static String |
getAssignedDomain(String hostname)
This method uses the effective TLD to determine which component of a FQDN
is the NIC-assigned domain name.
|
static String |
getAssignedDomain(String hostname,
boolean strict)
This method uses the effective TLD to determine which component of a FQDN
is the NIC-assigned domain name.
|
static EffectiveTldFinder.EffectiveTLD |
getEffectiveTLD(String hostname)
Get EffectiveTLD for host name using the singleton instance of
EffectiveTldFinder.
|
static Map<String,EffectiveTldFinder.EffectiveTLD> |
getEffectiveTLDs() |
static EffectiveTldFinder |
getInstance()
Get singleton instance of EffectiveTldFinder with default configuration.
|
boolean |
initialize(boolean excludePrivateDomains)
(Re)initialize EffectiveTldFinder with built-in public suffix list.
|
boolean |
initialize(InputStream effectiveTldDataStream)
(Re)initialize EffectiveTldFinder with custom public suffix list.
|
boolean |
initialize(InputStream effectiveTldDataStream,
boolean excludePrivateDomains)
(Re)initialize EffectiveTldFinder with custom public suffix list.
|
boolean |
isConfigured() |
public static final String ETLD_DATA
public static final String COMMENT
public static final String DOT_REGEX
public static final String EXCEPTION
public static final String WILD_CARD
public static final char DOT
public static EffectiveTldFinder getInstance()
public boolean initialize(boolean excludePrivateDomains)
excludePrivateDomains
- whether to exclude the public suffixes listed in the PRIVATE
domain section (opposed to "ICANN" domains)public boolean initialize(InputStream effectiveTldDataStream)
effectiveTldDataStream
- content of public suffix list as input streampublic boolean initialize(InputStream effectiveTldDataStream, boolean excludePrivateDomains)
effectiveTldDataStream
- content of public suffix list as input streamexcludePrivateDomains
- whether to exclude the public suffixes listed in the PRIVATE
domain section (opposed to "ICANN" domains)public static Map<String,EffectiveTldFinder.EffectiveTLD> getEffectiveTLDs()
public static EffectiveTldFinder.EffectiveTLD getEffectiveTLD(String hostname)
hostname
- the hostname for which to find the EffectiveTldFinder.EffectiveTLD
EffectiveTldFinder.EffectiveTLD
public static String getAssignedDomain(String hostname)
hostname
- a string for which to obtain a NIC-assigned domain namepublic static String getAssignedDomain(String hostname, boolean strict)
hostname
- a string for which to obtain a NIC-assigned domain namestrict
- do not return the hostname as fall-back if a FQDN with valid
TLD cannot be determinedpublic boolean isConfigured()
Copyright © 2009–2017 Crawler-Commons. All rights reserved.