Package org.jamwiki

Examples of org.jamwiki.DataAccessException


  private static void initialize() throws DataAccessException {
    File file = null;
    try {
      file = Utilities.getClassLoaderFile(SPAM_BLACKLIST_FILE);
    } catch (IOException e) {
      throw new DataAccessException("I/O exception while initlaizing spam blacklist", e);
    }
    String regex = "";
    String regexText = null;
    try {
      regexText = FileUtils.readFileToString(file, "UTF-8").trim();
    } catch (IOException e) {
      throw new DataAccessException("I/O exception while initlaizing spam blacklist", e);
    }
    String[] tokens = regexText.split("\n");
    for (int i = 0; i < tokens.length; i++) {
      String token = tokens[i];
      if (StringUtils.isBlank(token)) {
        continue;
      }
      if (i > 0) {
        regex += "|";
      }
      regex += token.trim();
    }
    try {
      spamRegexPattern = Pattern.compile(regex, Pattern.CASE_INSENSITIVE);
    } catch (PatternSyntaxException e) {
      throw new DataAccessException("Failure while parsing spam regular expression list", e);
    }
    logger.info("Loading spam filter regular expression:" + regex);
  }
View Full Code Here


    }
    String contents = null;
    try {
      contents = WikiUtil.readSpecialPage(locale, topicName);
    } catch (IOException e) {
      throw new DataAccessException(e);
    }
    Topic topic = new Topic();
    topic.setName(topicName);
    topic.setVirtualWiki(virtualWiki);
    topic.setTopicContent(contents);
View Full Code Here

TOP

Related Classes of org.jamwiki.DataAccessException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.