public class URIScanner extends Object
Constructor and Description |
---|
URIScanner() |
Modifier and Type | Method and Description |
---|---|
protected static String |
domainFromHost(String host)
Extracts and returns the registrar domain portion of a host string.
|
protected static String |
hostFromUriStr(String uriStr)
Extracts and returns the host portion of URI string.
|
static HashSet<String> |
scanContentForDomains(HashSet<String> domains,
CharSequence content)
Scans a character sequence for URIs.
|
protected static HashSet<String> |
scanContentForHosts(CharSequence content)
Scans a character sequence for URIs.
|
public static HashSet<String> scanContentForDomains(HashSet<String> domains, CharSequence content)
Scans a character sequence for URIs. Then add all unique domain strings derived from those found URIs to the supplied HashSet.
This function calls scanContentForHosts() to grab all the host strings. Then it calls domainFromHost() on each host string found to distill them to their basic "registrar" domains.
domains
- a HashSet to be populated with all domain strings found in the
contentcontent
- a character sequence to be scanned for URIsprotected static HashSet<String> scanContentForHosts(CharSequence content)
content
- a character sequence to be scanned for URIsprotected static String hostFromUriStr(String uriStr)
uriStr
- a string containing a URIprotected static String domainFromHost(String host)
host
- a string containing a host nameCopyright © 2002-2012 The Apache Software Foundation. All Rights Reserved.