public class BrowserWidgetHostChecker extends Object
Constructor and Description |
---|
BrowserWidgetHostChecker() |
Modifier and Type | Method and Description |
---|---|
static boolean |
blacklistRegexes(String regexes)
This method blacklists the supplied regexes, separated by comma or space.
|
static void |
blacklistURL(String url)
This method blacklists the supplied URL, and any that share the same host.
|
static String |
checkHost(String hostUnderConsideration,
Set<String> hosts)
This method checks the host to see if it is in the supplied set of regexes.
|
static String |
computeHostRegex(String url)
This method computes the host regular expression for the given url.
|
static String |
formatBlackList()
This method formats the blacklist for display in the treeLogger.
|
static String |
formatRules(Set<String> hosts)
This method formats the list of rules for display in the treeLogger.
|
static String |
formatWhiteList()
This method formats the whitelist for display in the treeLogger.
|
static boolean |
isAlwaysWhitelisted(String url)
This method returns true if the host is always admissible, regardless of
the blacklist.
|
static String |
matchBlacklisted(String url)
This method returns non-null if the host is forbidden.
|
static String |
matchWhitelisted(String url)
This method returns null if the host is admissible, provided it is not on
the blacklist.
|
static void |
notifyBlacklistedHost(String blacklistRuleFound,
String url,
TreeLogger header,
TreeLogger.Type msgType)
This method formats a message, and logs it to the treelogger, stating that
the url was blocked.
|
static void |
notifyUntrustedHost(String url,
TreeLogger header,
TreeLogger.Type msgType)
This method formats a message, and logs it to the treelogger, stating that
the url was not trusted.
|
static boolean |
whitelistRegexes(String regexes)
This method whitelists the supplied String of regexes, separated by comma
or space.
|
static void |
whitelistURL(String url)
This method whitelists the supplied URL, and any that share the same host.
|
public static boolean blacklistRegexes(String regexes)
regexes
- the regexes to be forbiddenpublic static void blacklistURL(String url)
url
- the host to be forbiddenpublic static String checkHost(String hostUnderConsideration, Set<String> hosts)
hostUnderConsideration
- the host to be checkedhosts
- the set of regexes to be checked againstpublic static String computeHostRegex(String url)
url
- the url to be allowed or disallowedpublic static String formatBlackList()
public static String formatRules(Set<String> hosts)
hosts
- the set of regexes that match hostspublic static String formatWhiteList()
public static boolean isAlwaysWhitelisted(String url)
url
- the URL to be verifiedpublic static String matchBlacklisted(String url)
url
- the URL to be verifiedpublic static String matchWhitelisted(String url)
url
- the URL to be verifiedpublic static void notifyBlacklistedHost(String blacklistRuleFound, String url, TreeLogger header, TreeLogger.Type msgType)
url
- the URL that was disallowedheader
- the treelogger under which these messages will be putmsgType
- either a caution or an errorpublic static void notifyUntrustedHost(String url, TreeLogger header, TreeLogger.Type msgType)
url
- the URL that provoked the dialog boxheader
- the treelogger under which these messages will be putmsgType
- either a caution or an errorpublic static boolean whitelistRegexes(String regexes)
regexes
- the regexes to be allowedpublic static void whitelistURL(String url)
url
- the host to be allowedCopyright © 2018. All rights reserved.