org.apache.hc.client5.http.psl

## Class PublicSuffixListParser

- java.lang.Object
- - org.apache.hc.client5.http.psl.PublicSuffixListParser

-     @Contract(threading=STATELESS)
      public final class PublicSuffixListParser
      extends Object

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

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `PublicSuffixListParser()`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `PublicSuffixList` | `parse(Reader reader)` Parses the public suffix list format.
    `List<PublicSuffixList>` | `parseByType(Reader reader)` Parses the public suffix list format by domain type (currently supported ICANN and PRIVATE).

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### PublicSuffixListParser

          public PublicSuffixListParser()

  - ### Method Detail

    - #### parse

          public PublicSuffixList parse(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` - the data reader. The caller is responsible for closing the reader.
      Throws:
        `IOException` - on error while reading from list

    - #### parseByType

          public List<PublicSuffixList> parseByType(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` - the data reader. The caller is responsible for closing the reader.
      Throws:
        `IOException` - on error while reading from list
      Since:
        4.5

Copyright © 1999–2022 The Apache Software Foundation. All rights reserved.