java.lang.Object
com.aoapps.tlds.TopLevelDomain
Provides access to the current top level domains.
As a fall-back, a copy of the top-level domain list is bundled within this API.
The list is self-updated from data.iana.org.
Updates are persisted via the Java Preferences API.
- Author:
- AO Industries, Inc.
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
One snapshot of the data, representing the state at one moment in time. -
Method Summary
Modifier and TypeMethodDescriptionstatic String
getByLabel
(String label) Provides a way to get the top level domain based on label (case-insensitive).Gets an unmodifiable list of the comments contained within tlds-alpha-by-domain.txt.static long
Gets the last time the list was successfully updated.static long
Gets the last time the list was updated, whether successful or not.static boolean
Gets whether the last update was successful.static TopLevelDomain.Snapshot
Gets a snapshot of the current set of top-level domains, in the case and order contained within tlds-alpha-by-domain.txt.Gets an unmodifiable list of the most recently retrieved top-level domains, in the case and order contained within tlds-alpha-by-domain.txt.static boolean
Gets whether or not this is the bundled bootstrap data.
-
Method Details
-
getSnapshot
Gets a snapshot of the current set of top-level domains, in the case and order contained within tlds-alpha-by-domain.txt. Will trigger asynchronous background update if it is time to to so, but will use the currently available data and not wait for the update to complete. -
getTopLevelDomains
Gets an unmodifiable list of the most recently retrieved top-level domains, in the case and order contained within tlds-alpha-by-domain.txt.Each element is
interned
.- See Also:
-
getComments
Gets an unmodifiable list of the comments contained within tlds-alpha-by-domain.txt. All lines starting with"#"
are considered to be comments.- See Also:
-
getLastUpdatedTime
public static long getLastUpdatedTime()Gets the last time the list was updated, whether successful or not.- See Also:
-
isBootstrap
public static boolean isBootstrap()Gets whether or not this is the bundled bootstrap data.- Returns:
true
if this is the included bootstrap data, orfalse
is this is auto-updated- See Also:
-
getLastUpdateSuccessful
public static boolean getLastUpdateSuccessful()Gets whether the last update was successful.- See Also:
-
getLastSuccessfulUpdateTime
public static long getLastSuccessfulUpdateTime()Gets the last time the list was successfully updated.- See Also:
-
getByLabel
Provides a way to get the top level domain based on label (case-insensitive).Any non-null returned value is
interned
.- Returns:
- The top level domain based on label (case-insensitive) or
null
if no match. - See Also:
-