java.lang.Object
net.i2p.apache.http.conn.util.PublicSuffixListParser
Parses the list from publicsuffix.org and configures a PublicSuffixFilter.
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final intLongest line the parser accepts.Constructor Summary
ConstructorsConstructorDescriptionCreates a parser for the public suffix list file format.Method Summary
Modifier and TypeMethodDescriptionParses the public suffix list format.private booleanreadLine(Reader r, StringBuilder sb) Reads one line, stopping at the first whitespace.
Field Details
MAX_LINE_LEN
Constructor Details
PublicSuffixListParser
public PublicSuffixListParser()Creates a parser for the public suffix list file format.
Method Details
parse
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.- Returns:
- the parsed suffix rules and exceptions, ready for
PublicSuffixList - Throws:
IOException- on error while reading from list
readLine
Reads one line, stopping at the first whitespace.- Parameters:
r- where to readsb- receives the line, cleared first- Returns:
- true if a line was read
- Throws:
IOException- if the read fails