public class PublicSuffixes
extends java.lang.Object
| Modifier and Type | Class and Description |
|---|---|
static class |
PublicSuffixes.Node
prefix tree node.
|
| Modifier and Type | Field and Description |
|---|---|
protected static java.util.regex.Pattern |
topmostAssignedSurtPrefixPattern |
protected static java.lang.String |
topmostAssignedSurtPrefixRegex |
| Constructor and Description |
|---|
PublicSuffixes() |
| Modifier and Type | Method and Description |
|---|---|
protected static void |
buildRegex(PublicSuffixes.Node alt,
java.lang.StringBuilder sb)
bulids regular expression from prefix-tree
alt into buffer sb. |
static void |
dump(PublicSuffixes.Node alt,
int lv,
java.io.PrintWriter out)
utility function for dumping prefix tree structure.
|
static java.util.regex.Pattern |
getTopmostAssignedSurtPrefixPattern() |
static java.lang.String |
getTopmostAssignedSurtPrefixRegex() |
static java.lang.String |
getTopmostAssignedSurtPrefixRegex(java.io.BufferedReader reader) |
static void |
main(java.lang.String[] args)
Utility method for dumping a regex String, based on a published public
suffix list, which matches any SURT-form hostname up through the broadest
'private' (assigned/sold) domain-segment.
|
protected static PublicSuffixes.Node |
readPublishedFileToSurtTrie(java.io.BufferedReader reader)
Reads a file of the format promulgated by publicsuffix.org, ignoring
comments and '!' exceptions/notations, converting domain segments to
SURT-ordering.
|
static java.lang.String |
reduceSurtToAssignmentLevel(java.lang.String surt)
Truncate SURT to its topmost assigned domain segment; that is,
the public suffix plus one segment, but as a SURT-ordered prefix.
|
protected static java.util.regex.Pattern topmostAssignedSurtPrefixPattern
protected static java.lang.String topmostAssignedSurtPrefixRegex
public static void main(java.lang.String[] args)
throws java.io.IOException
args - java.io.IOExceptionprotected static PublicSuffixes.Node readPublishedFileToSurtTrie(java.io.BufferedReader reader) throws java.io.IOException
reader - java.io.IOExceptionpublic static void dump(PublicSuffixes.Node alt, int lv, java.io.PrintWriter out)
alt - root of prefix tree.lv - indent level. 0 for root (no indent).out - writer to send output to.protected static void buildRegex(PublicSuffixes.Node alt, java.lang.StringBuilder sb)
alt into buffer sb.alt - prefix tree root.sb - StringBuffer to store regular expression.public static java.util.regex.Pattern getTopmostAssignedSurtPrefixPattern()
public static java.lang.String getTopmostAssignedSurtPrefixRegex()
public static java.lang.String getTopmostAssignedSurtPrefixRegex(java.io.BufferedReader reader)
public static java.lang.String reduceSurtToAssignmentLevel(java.lang.String surt)
surt - SURT to truncateCopyright © 2019 The International Internet Preservation Consortium. All Rights Reserved.