| java.lang.Object org.apache.roller.util.Blacklist
Blacklist | public class Blacklist (Code) | | Loads MT-Blacklist style blacklist from disk and allows callers to test
strings against the blacklist and (optionally) addition blacklists.
First looks for blacklist.txt in uploads directory, than in classpath
as /blacklist.txt. Download from web feature disabed.
Blacklist is formatted one entry per line.
Any line that begins with # is considered to be a comment.
Any line that begins with ( is considered to be a regex expression.
For more information on the (discontinued) MT-Blacklist service:
http://www.jayallen.org/projects/mt-blacklist.
author: Lance Lavandowska author: Allen Gilliland |
checkForUpdate | public static void checkForUpdate()(Code) | | Updated MT blacklist if necessary.
|
getBlacklist | public static Blacklist getBlacklist()(Code) | | Singleton factory method.
|
isBlacklisted | public boolean isBlacklisted(String str)(Code) | | Does the String argument match any of the rules in the built-in blacklist?
|
isBlacklisted | public boolean isBlacklisted(String str, List moreStringRules, List moreRegexRules)(Code) | | Does the String argument match any of the rules in the built-in blacklist
plus additional blacklists provided by caller?
Parameters: str - String to be checked against blacklist Parameters: moreStringRules - Additional string rules to consider Parameters: moreRegexRules - Additional regex rules to consider |
loadBlacklistFromFile | public void loadBlacklistFromFile(String blacklistFilePath)(Code) | | Load the MT blacklist from the file system.
We look for a previously downloaded version of the blacklist first and
if it's not found then we load the default blacklist packed with Roller.
Only public for purposes of unit testing.
|
matchesRulesOnly | public static boolean matchesRulesOnly(String str, List stringRules, List regexRules)(Code) | | Test string only against rules provided by caller, NOT against built-in blacklist.
Parameters: str - String to be checked against rules Parameters: moreStringRules - String rules to consider Parameters: moreRegexRules - Regex rules to consider |
populateSpamRules | public static void populateSpamRules(String blacklist, List stringRules, List regexRules, String addendum)(Code) | | Utility method to populate lists based a blacklist in string form
|
toString | public String toString()(Code) | | Return pretty list of String and RegEx rules.
|
update | public void update()(Code) | | Non-Static update method.
|
|
|