|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectfable.adt.FableCensor
public class FableCensor
FableCensor is the class that contains data about the password, as well as banned URLs and banned Keywords!
bannedURLs
The set of banned urls
bannedKeywords
The set of banned keywords
password
The hashed password of this censor
Constructor Summary | |
---|---|
FableCensor(java.lang.String hash)
Create a new FableCensor |
Method Summary | |
---|---|
boolean |
addBannedKeyword(java.lang.String bannedKeyword)
Adds a bannedKeyword to the list of banned Keywords |
boolean |
addBannedURL(java.lang.String bannedURL)
Adds a bannedURL to the list of banned URLs |
void |
changePassword(java.lang.String newPassword)
Changes the password |
java.util.Collection<java.lang.String> |
getBannedKeywords()
|
java.util.Collection<java.lang.String> |
getBannedURLs()
|
java.lang.String |
getHash()
Returns the hashed password |
static java.lang.String |
hash(java.lang.String password)
Returns the hash of a particular password |
boolean |
isOkArticleContent(Article a)
Checks if the content of an article (summary/html/title/author) is ok for the censor |
boolean |
isOkURL(java.lang.String url)
Checks if the URL is acceptable according to the censor |
boolean |
okPassword(java.lang.String password)
Checks if the password matches! |
boolean |
removeBannedKeyword(java.lang.String bannedKeyword)
Remove a banned keyword from the set of bannedKeywords |
boolean |
removeBannedURL(java.lang.String bannedURL)
Remove a bannedURL from the set of bannedURLs |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public FableCensor(java.lang.String hash)
hash
- Hashcode of the password. Pass in the hash, NOT the string itself!Method Detail |
---|
public static java.lang.String hash(java.lang.String password)
password
-
public java.lang.String getHash()
public boolean okPassword(java.lang.String password)
password
- Password to check for
public void changePassword(java.lang.String newPassword)
newPassword
- The new passwordpublic boolean addBannedURL(java.lang.String bannedURL)
bannedURL
- bannedURL
public boolean addBannedKeyword(java.lang.String bannedKeyword)
bannedKeyword
- bannedKeyword
public boolean removeBannedURL(java.lang.String bannedURL)
bannedURL
-
public boolean removeBannedKeyword(java.lang.String bannedKeyword)
bannedKeyword
-
public java.util.Collection<java.lang.String> getBannedURLs()
public java.util.Collection<java.lang.String> getBannedKeywords()
public boolean isOkURL(java.lang.String url)
url
- URL to check
public boolean isOkArticleContent(Article a)
a
- Article to check
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |