public class PublicSuffixes extends Object
| Modifier and Type | Class and Description |
|---|---|
static class |
PublicSuffixes.Node
prefix tree node.
|
| Modifier and Type | Field and Description |
|---|---|
protected static Pattern |
topmostAssignedSurtPrefixPattern |
protected static String |
topmostAssignedSurtPrefixRegex |
| Constructor and Description |
|---|
PublicSuffixes() |
| Modifier and Type | Method and Description |
|---|---|
protected static void |
buildRegex(PublicSuffixes.Node alt,
StringBuilder sb)
bulids regular expression from prefix-tree
alt into buffer sb. |
static void |
dump(PublicSuffixes.Node alt,
int lv,
PrintWriter out)
utility function for dumping prefix tree structure.
|
static Pattern |
getTopmostAssignedSurtPrefixPattern() |
static String |
getTopmostAssignedSurtPrefixRegex() |
static String |
getTopmostAssignedSurtPrefixRegex(BufferedReader reader) |
static void |
main(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(BufferedReader reader)
Reads a file of the format promulgated by publicsuffix.org, ignoring
comments and '!' exceptions/notations, converting domain segments to
SURT-ordering.
|
static String |
reduceSurtToAssignmentLevel(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 Pattern topmostAssignedSurtPrefixPattern
protected static String topmostAssignedSurtPrefixRegex
public static void main(String[] args) throws IOException
args - IOExceptionprotected static PublicSuffixes.Node readPublishedFileToSurtTrie(BufferedReader reader) throws IOException
reader - IOExceptionpublic static void dump(PublicSuffixes.Node alt, int lv, 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, StringBuilder sb)
alt into buffer sb.alt - prefix tree root.sb - StringBuffer to store regular expression.public static Pattern getTopmostAssignedSurtPrefixPattern()
public static String getTopmostAssignedSurtPrefixRegex()
public static String getTopmostAssignedSurtPrefixRegex(BufferedReader reader)
public static String reduceSurtToAssignmentLevel(String surt)
surt - SURT to truncateCopyright © 2015 The International Internet Preservation Consortium. All Rights Reserved.