fable.io
Class ArticleManager

java.lang.Object
  extended by fable.io.ArticleManager

public class ArticleManager
extends java.lang.Object

ArticleManager is a class for management of Article I/O. This includes generating keywords and writing article content to file

Author:
Christopher Moh

Method Summary
static java.util.Set<java.lang.String> generateKeywords(Article a)
          Generates a set of keywords for a given article
static java.lang.String getContents(Article a)
          Gets the html contents of an article
static boolean removeArticle(Article a)
          Removes an article content by deleting the file
static boolean setContents(Article a, java.lang.String articleContent)
          Set the contents of an article to a html represented in the form of a string
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

setContents

public static boolean setContents(Article a,
                                  java.lang.String articleContent)
Set the contents of an article to a html represented in the form of a string

Parameters:
a - Article to change html content
articleContent - HTML string that represents the html content
Returns:
true if article file can be written, false otherwise
Requires:
a, articleContent != null

getContents

public static java.lang.String getContents(Article a)
Gets the html contents of an article

Parameters:
a - Article to get html content from
Returns:
HTML string representing the article to get content from, or null if no such content exists
Requires:
a != null

removeArticle

public static boolean removeArticle(Article a)
Removes an article content by deleting the file

Parameters:
a - Article to remove
Returns:
true if article can be removed, false otherwise
Requires:
a != null

generateKeywords

public static java.util.Set<java.lang.String> generateKeywords(Article a)
Generates a set of keywords for a given article

Parameters:
a - Article to generate keywords from
Returns:
Set of keywords
Requires:
a != null