Top Description Fields Constructors Methods
org.apache.hc.client5.http.psl

public final Class PublicSuffixListParser

extends Object
Class Inheritance
Annotations
@Contract
threading:STATELESS
Imports
java.io.BufferedReader, .IOException, .Reader, java.util.ArrayList, .List, org.apache.hc.core5.annotation.Contract, .ThreadingBehavior

Parses the list from publicsuffix.org and configures a PublicSuffixFilter.
Since
4.4

Field Summary

Modifier and TypeField and Description
public static final PublicSuffixListParser
INSTANCE

Singleton instance.

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public PublicSuffixList
parse(final Reader
the data reader. The caller is responsible for closing the reader.
reader
)

Parses the public suffix list format.

public List<PublicSuffixList>
parseByType(final Reader
the data reader. The caller is responsible for closing the reader.
reader
)

Parses the public suffix list format by domain type (currently supported ICANN and PRIVATE).

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

INSTANCEback to summary
public static final PublicSuffixListParser INSTANCE

Singleton instance.

Since
5.2

Constructor Detail

PublicSuffixListParserback to summary
public PublicSuffixListParser()

Method Detail

parseback to summary
public PublicSuffixList parse(final Reader reader) throws IOException

Parses the public suffix list format.

When creating the reader from the file, make sure to use the correct encoding (the original list is in UTF-8).

Parameters
reader:Reader

the data reader. The caller is responsible for closing the reader.

Exceptions
IOException:
on error while reading from list
parseByTypeback to summary
public List<PublicSuffixList> parseByType(final Reader reader) throws IOException

Parses the public suffix list format by domain type (currently supported ICANN and PRIVATE).

When creating the reader from the file, make sure to use the correct encoding (the original list is in UTF-8).

Parameters
reader:Reader

the data reader. The caller is responsible for closing the reader.

Exceptions
IOException:
on error while reading from list
Since
4.5