//# 0 errors, 347 messages
//#
/*
    //#utilities.java:1:1: class: net.sourceforge.pebble.util.Utilities$1
    //#utilities.java:1:1: method: net.sourceforge.pebble.util.Utilities$1.net.sourceforge.pebble.util.Utilities$1__static_init
    //#utilities.java:1:1: class: net.sourceforge.pebble.util.Utilities
 * Copyright (c) 2003-2005, Simon Brown
 * All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions are met:
 *
 *   - Redistributions of source code must retain the above copyright
 *     notice, this list of conditions and the following disclaimer.
 *
 *   - Redistributions in binary form must reproduce the above copyright
 *     notice, this list of conditions and the following disclaimer in
 *     the documentation and/or other materials provided with the
 *     distribution.
 *
 *   - Neither the name of Pebble nor the names of its contributors may
 *     be used to endorse or promote products derived from this software
 *     without specific prior written permission.
 *
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 * POSSIBILITY OF SUCH DAMAGE.
 */
package net.sourceforge.pebble.util;

import net.sourceforge.pebble.Configuration;
import net.sourceforge.pebble.PebbleContext;
import net.sourceforge.pebble.dao.CategoryDAO;
import net.sourceforge.pebble.dao.DAOFactory;
import net.sourceforge.pebble.dao.file.*;
import net.sourceforge.pebble.domain.*;
import net.sourceforge.pebble.api.event.comment.CommentEvent;
import net.sourceforge.pebble.api.event.trackback.TrackBackEvent;
import net.sourceforge.pebble.event.response.IpAddressListener;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;

import java.io.File;
import java.io.FileInputStream;
import java.io.FilenameFilter;
import java.util.*;
import java.text.SimpleDateFormat;

/**
 * Utilities for the current blog, such as those useful for moving
 * between versions of Pebble.
 *
 * @author    Simon Brown
 */
public class Utilities {
    //#utilities.java:58: method: void net.sourceforge.pebble.util.Utilities.net.sourceforge.pebble.util.Utilities()
    //#utilities.java:58: end of method: void net.sourceforge.pebble.util.Utilities.net.sourceforge.pebble.util.Utilities()

  /** the logger used by this action */
  private static final Log log = LogFactory.getLog(Utilities.class);
    //#utilities.java:61: method: net.sourceforge.pebble.util.Utilities.net.sourceforge.pebble.util.Utilities__static_init
    //#utilities.java:61: Warning: method not available
    //#    -- call on Log org.apache.commons.logging.LogFactory:getLog(Class)
    //#    severity: INFORMATIONAL
    //#    class: net.sourceforge.pebble.util.Utilities
    //#    method: net.sourceforge.pebble.util.Utilities__static_init
    //#    unanalyzed callee: Log org.apache.commons.logging.LogFactory:getLog(Class)
    //#output(net.sourceforge.pebble.util.Utilities__static_init): __Descendant_Table[net/sourceforge/pebble/util/Utilities]
    //#output(net.sourceforge.pebble.util.Utilities__static_init): log
    //#post(net.sourceforge.pebble.util.Utilities__static_init): __Descendant_Table[net/sourceforge/pebble/util/Utilities] == &__Dispatch_Table
    //#post(net.sourceforge.pebble.util.Utilities__static_init): init'ed(log)
    //#utilities.java:61: end of method: net.sourceforge.pebble.util.Utilities.net.sourceforge.pebble.util.Utilities__static_init

  /**
   * Builds the indexes for the given blog.
   *
   * @param blog    a Blog instance
   */
  public static void buildIndexes(Blog blog) {
    log.info("Reindexing blog");
    //#utilities.java:69: method: void net.sourceforge.pebble.util.Utilities.buildIndexes(Blog)
    //#utilities.java:69: Warning: method not available
    //#    -- call on void org.apache.commons.logging.Log:info(Object)
    //#    severity: INFORMATIONAL
    //#    class: net.sourceforge.pebble.util.Utilities
    //#    method: void buildIndexes(Blog)
    //#    unanalyzed callee: void org.apache.commons.logging.Log:info(Object)
    //#input(void buildIndexes(Blog)): blog
    //#input(void buildIndexes(Blog)): log
    //#pre[1] (void buildIndexes(Blog)): blog != null
    //#presumption(void buildIndexes(Blog)): org.apache.commons.logging.LogFactory:getLog(...)@61 != null
    blog.reindex();
    //#utilities.java:70: Warning: method not available
    //#    -- call on void net.sourceforge.pebble.domain.Blog:reindex()
    //#    severity: INFORMATIONAL
    //#    class: net.sourceforge.pebble.util.Utilities
    //#    method: void buildIndexes(Blog)
    //#    unanalyzed callee: void net.sourceforge.pebble.domain.Blog:reindex()
  }
    //#utilities.java:71: end of method: void net.sourceforge.pebble.util.Utilities.buildIndexes(Blog)

  /**
   * Builds the blacklist and whitelist of IP addresses from all responses
   * for the given blog.
   *
   * @param blog    a Blog instance
   */
  public static void buildIpAddressLists(Blog blog) {
    Iterator blogEntries = blog.getBlogEntries().iterator();
    //#utilities.java:80: method: void net.sourceforge.pebble.util.Utilities.buildIpAddressLists(Blog)
    //#utilities.java:80: Warning: method not available
    //#    -- call on List net.sourceforge.pebble.domain.Blog:getBlogEntries()
    //#    severity: INFORMATIONAL
    //#    class: net.sourceforge.pebble.util.Utilities
    //#    method: void buildIpAddressLists(Blog)
    //#    unanalyzed callee: List net.sourceforge.pebble.domain.Blog:getBlogEntries()
    //#input(void buildIpAddressLists(Blog)): blog
    //#input(void buildIpAddressLists(Blog)): log
    //#pre[1] (void buildIpAddressLists(Blog)): blog != null
    //#presumption(void buildIpAddressLists(Blog)): java.util.Iterator:next(...)@100 != null
    //#presumption(void buildIpAddressLists(Blog)): java.util.Iterator:next(...)@84 != null
    //#presumption(void buildIpAddressLists(Blog)): java.util.Iterator:next(...)@88 != null
    //#presumption(void buildIpAddressLists(Blog)): net.sourceforge.pebble.domain.Blog:getBlogEntries(...)@80 != null
    //#presumption(void buildIpAddressLists(Blog)): net.sourceforge.pebble.domain.BlogEntry:getComments(...)@86 != null
    //#presumption(void buildIpAddressLists(Blog)): net.sourceforge.pebble.domain.BlogEntry:getTrackBacks(...)@98 != null
    //#presumption(void buildIpAddressLists(Blog)): org.apache.commons.logging.LogFactory:getLog(...)@61 != null
    //#test_vector(void buildIpAddressLists(Blog)): java.util.Iterator:hasNext(...)@83: {1}, {0}
    //#test_vector(void buildIpAddressLists(Blog)): java.util.Iterator:hasNext(...)@87: {1}, {0}
    //#test_vector(void buildIpAddressLists(Blog)): java.util.Iterator:hasNext(...)@99: {1}, {0}
    //#test_vector(void buildIpAddressLists(Blog)): net.sourceforge.pebble.domain.Comment:isApproved(...)@89: {0}, {1}
    //#test_vector(void buildIpAddressLists(Blog)): net.sourceforge.pebble.domain.Comment:isRejected(...)@92: {0}, {1}
    //#test_vector(void buildIpAddressLists(Blog)): net.sourceforge.pebble.domain.TrackBack:isApproved(...)@101: {0}, {1}
    //#test_vector(void buildIpAddressLists(Blog)): net.sourceforge.pebble.domain.TrackBack:isRejected(...)@104: {0}, {1}
    IpAddressListener ipAddressListener = new IpAddressListener();
    //#utilities.java:81: Warning: method not available
    //#    -- call on void net.sourceforge.pebble.event.response.IpAddressListener()
    //#    severity: INFORMATIONAL
    //#    class: net.sourceforge.pebble.util.Utilities
    //#    method: void buildIpAddressLists(Blog)
    //#    unanalyzed callee: void net.sourceforge.pebble.event.response.IpAddressListener()

    while (blogEntries.hasNext()) {
      BlogEntry blogEntry = (BlogEntry)blogEntries.next();
      log.info("Processing " + blogEntry.getTitle() + " (" + blogEntry.getDate() + ")");
    //#utilities.java:85: Warning: method not available
    //#    -- call on String net.sourceforge.pebble.domain.BlogEntry:getTitle()
    //#    severity: INFORMATIONAL
    //#    class: net.sourceforge.pebble.util.Utilities
    //#    method: void buildIpAddressLists(Blog)
    //#    unanalyzed callee: String net.sourceforge.pebble.domain.BlogEntry:getTitle()
    //#utilities.java:85: Warning: method not available
    //#    -- call on Date net.sourceforge.pebble.domain.BlogEntry:getDate()
    //#    severity: INFORMATIONAL
    //#    class: net.sourceforge.pebble.util.Utilities
    //#    method: void buildIpAddressLists(Blog)
    //#    unanalyzed callee: Date net.sourceforge.pebble.domain.BlogEntry:getDate()
    //#utilities.java:85: Warning: method not available
    //#    -- call on void org.apache.commons.logging.Log:info(Object)
    //#    severity: INFORMATIONAL
    //#    class: net.sourceforge.pebble.util.Utilities
    //#    method: void buildIpAddressLists(Blog)
    //#    unanalyzed callee: void org.apache.commons.logging.Log:info(Object)
      Iterator comments = blogEntry.getComments().iterator();
    //#utilities.java:86: Warning: method not available
    //#    -- call on List net.sourceforge.pebble.domain.BlogEntry:getComments()
    //#    severity: INFORMATIONAL
    //#    class: net.sourceforge.pebble.util.Utilities
    //#    method: void buildIpAddressLists(Blog)
    //#    unanalyzed callee: List net.sourceforge.pebble.domain.BlogEntry:getComments()
      while (comments.hasNext()) {
        Comment comment = (Comment)comments.next();
        if (comment.isApproved()) {
    //#utilities.java:89: Warning: method not available
    //#    -- call on bool net.sourceforge.pebble.domain.Comment:isApproved()
    //#    severity: INFORMATIONAL
    //#    class: net.sourceforge.pebble.util.Utilities
    //#    method: void buildIpAddressLists(Blog)
    //#    unanalyzed callee: bool net.sourceforge.pebble.domain.Comment:isApproved()
          CommentEvent event = new CommentEvent(comment, CommentEvent.COMMENT_APPROVED);
    //#utilities.java:90: Warning: method not available
    //#    -- call on void net.sourceforge.pebble.api.event.comment.CommentEvent(Comment, int)
    //#    severity: INFORMATIONAL
    //#    class: net.sourceforge.pebble.util.Utilities
    //#    method: void buildIpAddressLists(Blog)
    //#    unanalyzed callee: void net.sourceforge.pebble.api.event.comment.CommentEvent(Comment, int)
          ipAddressListener.commentApproved(event);
    //#utilities.java:91: Warning: method not available
    //#    -- call on void net.sourceforge.pebble.event.response.IpAddressListener:commentApproved(CommentEvent)
    //#    severity: INFORMATIONAL
    //#    class: net.sourceforge.pebble.util.Utilities
    //#    method: void buildIpAddressLists(Blog)
    //#    unanalyzed callee: void net.sourceforge.pebble.event.response.IpAddressListener:commentApproved(CommentEvent)
        } else if (comment.isRejected()) {
    //#utilities.java:92: Warning: method not available
    //#    -- call on bool net.sourceforge.pebble.domain.Comment:isRejected()
    //#    severity: INFORMATIONAL
    //#    class: net.sourceforge.pebble.util.Utilities
    //#    method: void buildIpAddressLists(Blog)
    //#    unanalyzed callee: bool net.sourceforge.pebble.domain.Comment:isRejected()
          CommentEvent event = new CommentEvent(comment, CommentEvent.COMMENT_REJECTED);
    //#utilities.java:93: Warning: method not available
    //#    -- call on void net.sourceforge.pebble.api.event.comment.CommentEvent(Comment, int)
    //#    severity: INFORMATIONAL
    //#    class: net.sourceforge.pebble.util.Utilities
    //#    method: void buildIpAddressLists(Blog)
    //#    unanalyzed callee: void net.sourceforge.pebble.api.event.comment.CommentEvent(Comment, int)
          ipAddressListener.commentRejected(event);
    //#utilities.java:94: Warning: method not available
    //#    -- call on void net.sourceforge.pebble.event.response.IpAddressListener:commentRejected(CommentEvent)
    //#    severity: INFORMATIONAL
    //#    class: net.sourceforge.pebble.util.Utilities
    //#    method: void buildIpAddressLists(Blog)
    //#    unanalyzed callee: void net.sourceforge.pebble.event.response.IpAddressListener:commentRejected(CommentEvent)
        }
      }

      Iterator trackbacks = blogEntry.getTrackBacks().iterator();
    //#utilities.java:98: Warning: method not available
    //#    -- call on List net.sourceforge.pebble.domain.BlogEntry:getTrackBacks()
    //#    severity: INFORMATIONAL
    //#    class: net.sourceforge.pebble.util.Utilities
    //#    method: void buildIpAddressLists(Blog)
    //#    unanalyzed callee: List net.sourceforge.pebble.domain.BlogEntry:getTrackBacks()
      while (trackbacks.hasNext()) {
        TrackBack trackback = (TrackBack)trackbacks.next();
        if (trackback.isApproved()) {
    //#utilities.java:101: Warning: method not available
    //#    -- call on bool net.sourceforge.pebble.domain.TrackBack:isApproved()
    //#    severity: INFORMATIONAL
    //#    class: net.sourceforge.pebble.util.Utilities
    //#    method: void buildIpAddressLists(Blog)
    //#    unanalyzed callee: bool net.sourceforge.pebble.domain.TrackBack:isApproved()
          TrackBackEvent event = new TrackBackEvent(trackback, TrackBackEvent.TRACKBACK_APPROVED);
    //#utilities.java:102: Warning: method not available
    //#    -- call on void net.sourceforge.pebble.api.event.trackback.TrackBackEvent(TrackBack, int)
    //#    severity: INFORMATIONAL
    //#    class: net.sourceforge.pebble.util.Utilities
    //#    method: void buildIpAddressLists(Blog)
    //#    unanalyzed callee: void net.sourceforge.pebble.api.event.trackback.TrackBackEvent(TrackBack, int)
          ipAddressListener.trackBackApproved(event);
    //#utilities.java:103: Warning: method not available
    //#    -- call on void net.sourceforge.pebble.event.response.IpAddressListener:trackBackApproved(TrackBackEvent)
    //#    severity: INFORMATIONAL
    //#    class: net.sourceforge.pebble.util.Utilities
    //#    method: void buildIpAddressLists(Blog)
    //#    unanalyzed callee: void net.sourceforge.pebble.event.response.IpAddressListener:trackBackApproved(TrackBackEvent)
        } else if (trackback.isRejected()) {
    //#utilities.java:104: Warning: method not available
    //#    -- call on bool net.sourceforge.pebble.domain.TrackBack:isRejected()
    //#    severity: INFORMATIONAL
    //#    class: net.sourceforge.pebble.util.Utilities
    //#    method: void buildIpAddressLists(Blog)
    //#    unanalyzed callee: bool net.sourceforge.pebble.domain.TrackBack:isRejected()
          TrackBackEvent event = new TrackBackEvent(trackback, TrackBackEvent.TRACKBACK_REJECTED);
    //#utilities.java:105: Warning: method not available
    //#    -- call on void net.sourceforge.pebble.api.event.trackback.TrackBackEvent(TrackBack, int)
    //#    severity: INFORMATIONAL
    //#    class: net.sourceforge.pebble.util.Utilities
    //#    method: void buildIpAddressLists(Blog)
    //#    unanalyzed callee: void net.sourceforge.pebble.api.event.trackback.TrackBackEvent(TrackBack, int)
          ipAddressListener.trackBackRejected(event);
    //#utilities.java:106: Warning: method not available
    //#    -- call on void net.sourceforge.pebble.event.response.IpAddressListener:trackBackRejected(TrackBackEvent)
    //#    severity: INFORMATIONAL
    //#    class: net.sourceforge.pebble.util.Utilities
    //#    method: void buildIpAddressLists(Blog)
    //#    unanalyzed callee: void net.sourceforge.pebble.event.response.IpAddressListener:trackBackRejected(TrackBackEvent)
        }
      }
//
//      try {
//        blogEntry.store();
//      } catch (BlogServiceException e) {
//        log.error("Error storing " + blogEntry.getTitle() + " (" + blogEntry.getDate() + ")");
//      }
    }
  }
    //#utilities.java:116: end of method: void net.sourceforge.pebble.util.Utilities.buildIpAddressLists(Blog)

  /**
   * Fixes HTML escaping of comment and TrackBack content for the given blog.
   *
   * @param blog    a Blog instance
   */
  public static void fixHtmlInResponses(Blog blog) {
    Iterator blogEntries = blog.getBlogEntries().iterator();
    //#utilities.java:124: method: void net.sourceforge.pebble.util.Utilities.fixHtmlInResponses(Blog)
    //#utilities.java:124: Warning: method not available
    //#    -- call on List net.sourceforge.pebble.domain.Blog:getBlogEntries()
    //#    severity: INFORMATIONAL
    //#    class: net.sourceforge.pebble.util.Utilities
    //#    method: void fixHtmlInResponses(Blog)
    //#    unanalyzed callee: List net.sourceforge.pebble.domain.Blog:getBlogEntries()
    //#input(void fixHtmlInResponses(Blog)): blog
    //#input(void fixHtmlInResponses(Blog)): log
    //#pre[1] (void fixHtmlInResponses(Blog)): blog != null
    //#presumption(void fixHtmlInResponses(Blog)): java.util.Iterator:next(...)@126 != null
    //#presumption(void fixHtmlInResponses(Blog)): java.util.Iterator:next(...)@130 != null
    //#presumption(void fixHtmlInResponses(Blog)): java.util.Iterator:next(...)@139 != null
    //#presumption(void fixHtmlInResponses(Blog)): net.sourceforge.pebble.domain.Blog:getBlogEntries(...)@124 != null
    //#presumption(void fixHtmlInResponses(Blog)): net.sourceforge.pebble.domain.BlogEntry:getComments(...)@128 != null
    //#presumption(void fixHtmlInResponses(Blog)): net.sourceforge.pebble.domain.BlogEntry:getTrackBacks(...)@137 != null
    //#presumption(void fixHtmlInResponses(Blog)): net.sourceforge.pebble.domain.Comment:getBody(...)@132 != null
    //#presumption(void fixHtmlInResponses(Blog)): net.sourceforge.pebble.domain.Comment:getBody(...)@133 != null
    //#presumption(void fixHtmlInResponses(Blog)): net.sourceforge.pebble.domain.Comment:getBody(...)@134 != null
    //#presumption(void fixHtmlInResponses(Blog)): net.sourceforge.pebble.domain.TrackBack:getExcerpt(...)@141 != null
    //#presumption(void fixHtmlInResponses(Blog)): net.sourceforge.pebble.domain.TrackBack:getExcerpt(...)@142 != null
    //#presumption(void fixHtmlInResponses(Blog)): net.sourceforge.pebble.domain.TrackBack:getExcerpt(...)@143 != null
    //#presumption(void fixHtmlInResponses(Blog)): org.apache.commons.logging.LogFactory:getLog(...)@61 != null
    //#test_vector(void fixHtmlInResponses(Blog)): java.util.Iterator:hasNext(...)@125: {1}, {0}
    //#test_vector(void fixHtmlInResponses(Blog)): java.util.Iterator:hasNext(...)@129: {1}, {0}
    //#test_vector(void fixHtmlInResponses(Blog)): java.util.Iterator:hasNext(...)@138: {1}, {0}
    //#test_vector(void fixHtmlInResponses(Blog)): net.sourceforge.pebble.domain.Comment:getBody(...)@131: Addr_Set{null}, Inverse{null}
    //#test_vector(void fixHtmlInResponses(Blog)): net.sourceforge.pebble.domain.TrackBack:getExcerpt(...)@140: Addr_Set{null}, Inverse{null}
    while (blogEntries.hasNext()) {
      BlogEntry blogEntry = (BlogEntry)blogEntries.next();
      log.info("Processing " + blogEntry.getTitle() + " (" + blogEntry.getDate() + ")");
    //#utilities.java:127: Warning: method not available
    //#    -- call on String net.sourceforge.pebble.domain.BlogEntry:getTitle()
    //#    severity: INFORMATIONAL
    //#    class: net.sourceforge.pebble.util.Utilities
    //#    method: void fixHtmlInResponses(Blog)
    //#    unanalyzed callee: String net.sourceforge.pebble.domain.BlogEntry:getTitle()
    //#utilities.java:127: Warning: method not available
    //#    -- call on Date net.sourceforge.pebble.domain.BlogEntry:getDate()
    //#    severity: INFORMATIONAL
    //#    class: net.sourceforge.pebble.util.Utilities
    //#    method: void fixHtmlInResponses(Blog)
    //#    unanalyzed callee: Date net.sourceforge.pebble.domain.BlogEntry:getDate()
    //#utilities.java:127: Warning: method not available
    //#    -- call on void org.apache.commons.logging.Log:info(Object)
    //#    severity: INFORMATIONAL
    //#    class: net.sourceforge.pebble.util.Utilities
    //#    method: void fixHtmlInResponses(Blog)
    //#    unanalyzed callee: void org.apache.commons.logging.Log:info(Object)
      Iterator comments = blogEntry.getComments().iterator();
    //#utilities.java:128: Warning: method not available
    //#    -- call on List net.sourceforge.pebble.domain.BlogEntry:getComments()
    //#    severity: INFORMATIONAL
    //#    class: net.sourceforge.pebble.util.Utilities
    //#    method: void fixHtmlInResponses(Blog)
    //#    unanalyzed callee: List net.sourceforge.pebble.domain.BlogEntry:getComments()
      while (comments.hasNext()) {
        Comment comment = (Comment)comments.next();
        if (comment.getBody() != null) {
    //#utilities.java:131: Warning: method not available
    //#    -- call on String net.sourceforge.pebble.domain.Comment:getBody()
    //#    severity: INFORMATIONAL
    //#    class: net.sourceforge.pebble.util.Utilities
    //#    method: void fixHtmlInResponses(Blog)
    //#    unanalyzed callee: String net.sourceforge.pebble.domain.Comment:getBody()
          comment.setBody(comment.getBody().replaceAll("&amp;", "&"));
    //#utilities.java:132: Warning: method not available
    //#    -- call on String net.sourceforge.pebble.domain.Comment:getBody()
    //#    severity: INFORMATIONAL
    //#    class: net.sourceforge.pebble.util.Utilities
    //#    method: void fixHtmlInResponses(Blog)
    //#    unanalyzed callee: String net.sourceforge.pebble.domain.Comment:getBody()
    //#utilities.java:132: Warning: method not available
    //#    -- call on void net.sourceforge.pebble.domain.Comment:setBody(String)
    //#    severity: INFORMATIONAL
    //#    class: net.sourceforge.pebble.util.Utilities
    //#    method: void fixHtmlInResponses(Blog)
    //#    unanalyzed callee: void net.sourceforge.pebble.domain.Comment:setBody(String)
          comment.setBody(comment.getBody().replaceAll("&lt;", "<"));
    //#utilities.java:133: Warning: method not available
    //#    -- call on String net.sourceforge.pebble.domain.Comment:getBody()
    //#    severity: INFORMATIONAL
    //#    class: net.sourceforge.pebble.util.Utilities
    //#    method: void fixHtmlInResponses(Blog)
    //#    unanalyzed callee: String net.sourceforge.pebble.domain.Comment:getBody()
    //#utilities.java:133: Warning: method not available
    //#    -- call on void net.sourceforge.pebble.domain.Comment:setBody(String)
    //#    severity: INFORMATIONAL
    //#    class: net.sourceforge.pebble.util.Utilities
    //#    method: void fixHtmlInResponses(Blog)
    //#    unanalyzed callee: void net.sourceforge.pebble.domain.Comment:setBody(String)
          comment.setBody(comment.getBody().replaceAll("&gt;", ">"));
    //#utilities.java:134: Warning: method not available
    //#    -- call on String net.sourceforge.pebble.domain.Comment:getBody()
    //#    severity: INFORMATIONAL
    //#    class: net.sourceforge.pebble.util.Utilities
    //#    method: void fixHtmlInResponses(Blog)
    //#    unanalyzed callee: String net.sourceforge.pebble.domain.Comment:getBody()
    //#utilities.java:134: Warning: method not available
    //#    -- call on void net.sourceforge.pebble.domain.Comment:setBody(String)
    //#    severity: INFORMATIONAL
    //#    class: net.sourceforge.pebble.util.Utilities
    //#    method: void fixHtmlInResponses(Blog)
    //#    unanalyzed callee: void net.sourceforge.pebble.domain.Comment:setBody(String)
        }
      }
      Iterator trackbacks = blogEntry.getTrackBacks().iterator();
    //#utilities.java:137: Warning: method not available
    //#    -- call on List net.sourceforge.pebble.domain.BlogEntry:getTrackBacks()
    //#    severity: INFORMATIONAL
    //#    class: net.sourceforge.pebble.util.Utilities
    //#    method: void fixHtmlInResponses(Blog)
    //#    unanalyzed callee: List net.sourceforge.pebble.domain.BlogEntry:getTrackBacks()
      while (trackbacks.hasNext()) {
        TrackBack trackback = (TrackBack)trackbacks.next();
        if (trackback.getExcerpt() != null) {
    //#utilities.java:140: Warning: method not available
    //#    -- call on String net.sourceforge.pebble.domain.TrackBack:getExcerpt()
    //#    severity: INFORMATIONAL
    //#    class: net.sourceforge.pebble.util.Utilities
    //#    method: void fixHtmlInResponses(Blog)
    //#    unanalyzed callee: String net.sourceforge.pebble.domain.TrackBack:getExcerpt()
          trackback.setExcerpt(trackback.getExcerpt().replaceAll("&amp;", "&"));
    //#utilities.java:141: Warning: method not available
    //#    -- call on String net.sourceforge.pebble.domain.TrackBack:getExcerpt()
    //#    severity: INFORMATIONAL
    //#    class: net.sourceforge.pebble.util.Utilities
    //#    method: void fixHtmlInResponses(Blog)
    //#    unanalyzed callee: String net.sourceforge.pebble.domain.TrackBack:getExcerpt()
    //#utilities.java:141: Warning: method not available
    //#    -- call on void net.sourceforge.pebble.domain.TrackBack:setExcerpt(String)
    //#    severity: INFORMATIONAL
    //#    class: net.sourceforge.pebble.util.Utilities
    //#    method: void fixHtmlInResponses(Blog)
    //#    unanalyzed callee: void net.sourceforge.pebble.domain.TrackBack:setExcerpt(String)
          trackback.setExcerpt(trackback.getExcerpt().replaceAll("&lt;", "<"));
    //#utilities.java:142: Warning: method not available
    //#    -- call on String net.sourceforge.pebble.domain.TrackBack:getExcerpt()
    //#    severity: INFORMATIONAL
    //#    class: net.sourceforge.pebble.util.Utilities
    //#    method: void fixHtmlInResponses(Blog)
    //#    unanalyzed callee: String net.sourceforge.pebble.domain.TrackBack:getExcerpt()
    //#utilities.java:142: Warning: method not available
    //#    -- call on void net.sourceforge.pebble.domain.TrackBack:setExcerpt(String)
    //#    severity: INFORMATIONAL
    //#    class: net.sourceforge.pebble.util.Utilities
    //#    method: void fixHtmlInResponses(Blog)
    //#    unanalyzed callee: void net.sourceforge.pebble.domain.TrackBack:setExcerpt(String)
          trackback.setExcerpt(trackback.getExcerpt().replaceAll("&gt;", ">"));
    //#utilities.java:143: Warning: method not available
    //#    -- call on String net.sourceforge.pebble.domain.TrackBack:getExcerpt()
    //#    severity: INFORMATIONAL
    //#    class: net.sourceforge.pebble.util.Utilities
    //#    method: void fixHtmlInResponses(Blog)
    //#    unanalyzed callee: String net.sourceforge.pebble.domain.TrackBack:getExcerpt()
    //#utilities.java:143: Warning: method not available
    //#    -- call on void net.sourceforge.pebble.domain.TrackBack:setExcerpt(String)
    //#    severity: INFORMATIONAL
    //#    class: net.sourceforge.pebble.util.Utilities
    //#    method: void fixHtmlInResponses(Blog)
    //#    unanalyzed callee: void net.sourceforge.pebble.domain.TrackBack:setExcerpt(String)
        }
      }
      try {
        BlogService service = new BlogService();
    //#utilities.java:147: Warning: method not available
    //#    -- call on void net.sourceforge.pebble.domain.BlogService()
    //#    severity: INFORMATIONAL
    //#    class: net.sourceforge.pebble.util.Utilities
    //#    method: void fixHtmlInResponses(Blog)
    //#    unanalyzed callee: void net.sourceforge.pebble.domain.BlogService()
        service.putBlogEntry(blogEntry);
    //#utilities.java:148: Warning: method not available
    //#    -- call on void net.sourceforge.pebble.domain.BlogService:putBlogEntry(BlogEntry)
    //#    severity: INFORMATIONAL
    //#    class: net.sourceforge.pebble.util.Utilities
    //#    method: void fixHtmlInResponses(Blog)
    //#    unanalyzed callee: void net.sourceforge.pebble.domain.BlogService:putBlogEntry(BlogEntry)
      } catch (BlogServiceException e) {
        log.error("Error storing " + blogEntry.getTitle() + " (" + blogEntry.getDate() + ")");
    //#utilities.java:150: Warning: method not available
    //#    -- call on String net.sourceforge.pebble.domain.BlogEntry:getTitle()
    //#    severity: INFORMATIONAL
    //#    class: net.sourceforge.pebble.util.Utilities
    //#    method: void fixHtmlInResponses(Blog)
    //#    unanalyzed callee: String net.sourceforge.pebble.domain.BlogEntry:getTitle()
    //#utilities.java:150: Warning: method not available
    //#    -- call on Date net.sourceforge.pebble.domain.BlogEntry:getDate()
    //#    severity: INFORMATIONAL
    //#    class: net.sourceforge.pebble.util.Utilities
    //#    method: void fixHtmlInResponses(Blog)
    //#    unanalyzed callee: Date net.sourceforge.pebble.domain.BlogEntry:getDate()
    //#utilities.java:150: Warning: method not available
    //#    -- call on void org.apache.commons.logging.Log:error(Object)
    //#    severity: INFORMATIONAL
    //#    class: net.sourceforge.pebble.util.Utilities
    //#    method: void fixHtmlInResponses(Blog)
    //#    unanalyzed callee: void org.apache.commons.logging.Log:error(Object)
      }
    }
  }
    //#utilities.java:153: end of method: void net.sourceforge.pebble.util.Utilities.fixHtmlInResponses(Blog)

  /**
   * Converts flat categories to hierarchical categories.
   *
   * @param blog    a Blog instance
   */
  public static void convertCategories(Blog blog) {
    Properties categories = new Properties();
    //#utilities.java:161: method: void net.sourceforge.pebble.util.Utilities.convertCategories(Blog)
    //#input(void convertCategories(Blog)): blog
    //#input(void convertCategories(Blog)): log
    //#pre[1] (void convertCategories(Blog)): (soft) blog != null
    //#presumption(void convertCategories(Blog)): java.util.Iterator:next(...)@169 != null
    //#presumption(void convertCategories(Blog)): java.util.Properties:keySet(...)@167 != null
    //#presumption(void convertCategories(Blog)): net.sourceforge.pebble.dao.DAOFactory:getCategoryDAO(...)@181 != null
    //#presumption(void convertCategories(Blog)): net.sourceforge.pebble.dao.DAOFactory:getConfiguredFactory(...)@180 != null
    //#presumption(void convertCategories(Blog)): org.apache.commons.logging.LogFactory:getLog(...)@61 != null
    //#test_vector(void convertCategories(Blog)): java.lang.String:startsWith(...)@173: {1}, {0}
    try {
      FileInputStream in = new FileInputStream(new File(blog.getRoot(), "blog.categories"));
    //#utilities.java:163: Warning: method not available
    //#    -- call on String net.sourceforge.pebble.domain.Blog:getRoot()
    //#    severity: INFORMATIONAL
    //#    class: net.sourceforge.pebble.util.Utilities
    //#    method: void convertCategories(Blog)
    //#    unanalyzed callee: String net.sourceforge.pebble.domain.Blog:getRoot()
      categories.load(in);
      in.close();

      Iterator it = categories.keySet().iterator();
      while (it.hasNext()) {
        String id = (String)it.next();
        String name = categories.getProperty(id);
        Category category;

        if (!id.startsWith("/")) {
          category = new Category("/" + id, name);
    //#utilities.java:174: Warning: method not available
    //#    -- call on void net.sourceforge.pebble.domain.Category(String, String)
    //#    severity: INFORMATIONAL
    //#    class: net.sourceforge.pebble.util.Utilities
    //#    method: void convertCategories(Blog)
    //#    unanalyzed callee: void net.sourceforge.pebble.domain.Category(String, String)
        } else {
          category = new Category(id, name);
    //#utilities.java:176: Warning: method not available
    //#    -- call on void net.sourceforge.pebble.domain.Category(String, String)
    //#    severity: INFORMATIONAL
    //#    class: net.sourceforge.pebble.util.Utilities
    //#    method: void convertCategories(Blog)
    //#    unanalyzed callee: void net.sourceforge.pebble.domain.Category(String, String)
        }

        blog.addCategory(category);
    //#utilities.java:179: Warning: method not available
    //#    -- call on void net.sourceforge.pebble.domain.Blog:addCategory(Category)
    //#    severity: INFORMATIONAL
    //#    class: net.sourceforge.pebble.util.Utilities
    //#    method: void convertCategories(Blog)
    //#    unanalyzed callee: void net.sourceforge.pebble.domain.Blog:addCategory(Category)
        DAOFactory factory = DAOFactory.getConfiguredFactory();
    //#utilities.java:180: Warning: method not available
    //#    -- call on DAOFactory net.sourceforge.pebble.dao.DAOFactory:getConfiguredFactory()
    //#    severity: INFORMATIONAL
    //#    class: net.sourceforge.pebble.util.Utilities
    //#    method: void convertCategories(Blog)
    //#    unanalyzed callee: DAOFactory net.sourceforge.pebble.dao.DAOFactory:getConfiguredFactory()
        CategoryDAO dao = factory.getCategoryDAO();
    //#utilities.java:181: Warning: method not available
    //#    -- call on CategoryDAO net.sourceforge.pebble.dao.DAOFactory:getCategoryDAO()
    //#    severity: INFORMATIONAL
    //#    class: net.sourceforge.pebble.util.Utilities
    //#    method: void convertCategories(Blog)
    //#    unanalyzed callee: CategoryDAO net.sourceforge.pebble.dao.DAOFactory:getCategoryDAO()
        dao.addCategory(category, blog);
    //#utilities.java:182: Warning: method not available
    //#    -- call on void net.sourceforge.pebble.dao.CategoryDAO:addCategory(Category, Blog)
    //#    severity: INFORMATIONAL
    //#    class: net.sourceforge.pebble.util.Utilities
    //#    method: void convertCategories(Blog)
    //#    unanalyzed callee: void net.sourceforge.pebble.dao.CategoryDAO:addCategory(Category, Blog)
      }
    } catch (Exception e) {
      log.error("Exception encountered", e);
    //#utilities.java:185: Warning: method not available
    //#    -- call on void org.apache.commons.logging.Log:error(Object, Throwable)
    //#    severity: INFORMATIONAL
    //#    class: net.sourceforge.pebble.util.Utilities
    //#    method: void convertCategories(Blog)
    //#    unanalyzed callee: void org.apache.commons.logging.Log:error(Object, Throwable)
    }
  }
    //#utilities.java:187: end of method: void net.sourceforge.pebble.util.Utilities.convertCategories(Blog)

  /**
   * Moves blog entries from one category to another.
   *
   * @param blog    a Blog instance
   */
  public static void moveBlogEntriesFromCategory(Blog blog, Category from, Category to) {
    Iterator blogEntries = blog.getBlogEntries().iterator();
    //#utilities.java:195: method: void net.sourceforge.pebble.util.Utilities.moveBlogEntriesFromCategory(Blog, Category, Category)
    //#utilities.java:195: Warning: method not available
    //#    -- call on List net.sourceforge.pebble.domain.Blog:getBlogEntries()
    //#    severity: INFORMATIONAL
    //#    class: net.sourceforge.pebble.util.Utilities
    //#    method: void moveBlogEntriesFromCategory(Blog, Category, Category)
    //#    unanalyzed callee: List net.sourceforge.pebble.domain.Blog:getBlogEntries()
    //#input(void moveBlogEntriesFromCategory(Blog, Category, Category)): blog
    //#input(void moveBlogEntriesFromCategory(Blog, Category, Category)): from
    //#input(void moveBlogEntriesFromCategory(Blog, Category, Category)): log
    //#input(void moveBlogEntriesFromCategory(Blog, Category, Category)): to
    //#pre[1] (void moveBlogEntriesFromCategory(Blog, Category, Category)): blog != null
    //#presumption(void moveBlogEntriesFromCategory(Blog, Category, Category)): java.util.Iterator:next(...)@197 != null
    //#presumption(void moveBlogEntriesFromCategory(Blog, Category, Category)): net.sourceforge.pebble.domain.Blog:getBlogEntries(...)@195 != null
    //#presumption(void moveBlogEntriesFromCategory(Blog, Category, Category)): net.sourceforge.pebble.domain.BlogEntry:getCategories(...)@200 != null
    //#presumption(void moveBlogEntriesFromCategory(Blog, Category, Category)): org.apache.commons.logging.LogFactory:getLog(...)@61 != null
    //#test_vector(void moveBlogEntriesFromCategory(Blog, Category, Category)): java.util.Collection:contains(...)@201: {0}, {1}
    //#test_vector(void moveBlogEntriesFromCategory(Blog, Category, Category)): java.util.Iterator:hasNext(...)@196: {1}, {0}
    while (blogEntries.hasNext()) {
      BlogEntry blogEntry = (BlogEntry)blogEntries.next();
      log.info("Processing " + blogEntry.getTitle() + " (" + blogEntry.getDate() + ")");
    //#utilities.java:198: Warning: method not available
    //#    -- call on String net.sourceforge.pebble.domain.BlogEntry:getTitle()
    //#    severity: INFORMATIONAL
    //#    class: net.sourceforge.pebble.util.Utilities
    //#    method: void moveBlogEntriesFromCategory(Blog, Category, Category)
    //#    unanalyzed callee: String net.sourceforge.pebble.domain.BlogEntry:getTitle()
    //#utilities.java:198: Warning: method not available
    //#    -- call on Date net.sourceforge.pebble.domain.BlogEntry:getDate()
    //#    severity: INFORMATIONAL
    //#    class: net.sourceforge.pebble.util.Utilities
    //#    method: void moveBlogEntriesFromCategory(Blog, Category, Category)
    //#    unanalyzed callee: Date net.sourceforge.pebble.domain.BlogEntry:getDate()
    //#utilities.java:198: Warning: method not available
    //#    -- call on void org.apache.commons.logging.Log:info(Object)
    //#    severity: INFORMATIONAL
    //#    class: net.sourceforge.pebble.util.Utilities
    //#    method: void moveBlogEntriesFromCategory(Blog, Category, Category)
    //#    unanalyzed callee: void org.apache.commons.logging.Log:info(Object)

      Collection categories = blogEntry.getCategories();
    //#utilities.java:200: Warning: method not available
    //#    -- call on Set net.sourceforge.pebble.domain.BlogEntry:getCategories()
    //#    severity: INFORMATIONAL
    //#    class: net.sourceforge.pebble.util.Utilities
    //#    method: void moveBlogEntriesFromCategory(Blog, Category, Category)
    //#    unanalyzed callee: Set net.sourceforge.pebble.domain.BlogEntry:getCategories()
      if (categories.contains(from)) {
        categories.remove(from);
        categories.add(to);
        blogEntry.setCategories(categories);
    //#utilities.java:204: Warning: method not available
    //#    -- call on void net.sourceforge.pebble.domain.BlogEntry:setCategories(Collection)
    //#    severity: INFORMATIONAL
    //#    class: net.sourceforge.pebble.util.Utilities
    //#    method: void moveBlogEntriesFromCategory(Blog, Category, Category)
    //#    unanalyzed callee: void net.sourceforge.pebble.domain.BlogEntry:setCategories(Collection)

        try {
          BlogService service = new BlogService();
    //#utilities.java:207: Warning: method not available
    //#    -- call on void net.sourceforge.pebble.domain.BlogService()
    //#    severity: INFORMATIONAL
    //#    class: net.sourceforge.pebble.util.Utilities
    //#    method: void moveBlogEntriesFromCategory(Blog, Category, Category)
    //#    unanalyzed callee: void net.sourceforge.pebble.domain.BlogService()
          service.putBlogEntry(blogEntry);
    //#utilities.java:208: Warning: method not available
    //#    -- call on void net.sourceforge.pebble.domain.BlogService:putBlogEntry(BlogEntry)
    //#    severity: INFORMATIONAL
    //#    class: net.sourceforge.pebble.util.Utilities
    //#    method: void moveBlogEntriesFromCategory(Blog, Category, Category)
    //#    unanalyzed callee: void net.sourceforge.pebble.domain.BlogService:putBlogEntry(BlogEntry)
        } catch (BlogServiceException e) {
          log.info("Error storing " + blogEntry.getTitle() + " (" + blogEntry.getDate() + ")");
    //#utilities.java:210: Warning: method not available
    //#    -- call on String net.sourceforge.pebble.domain.BlogEntry:getTitle()
    //#    severity: INFORMATIONAL
    //#    class: net.sourceforge.pebble.util.Utilities
    //#    method: void moveBlogEntriesFromCategory(Blog, Category, Category)
    //#    unanalyzed callee: String net.sourceforge.pebble.domain.BlogEntry:getTitle()
    //#utilities.java:210: Warning: method not available
    //#    -- call on Date net.sourceforge.pebble.domain.BlogEntry:getDate()
    //#    severity: INFORMATIONAL
    //#    class: net.sourceforge.pebble.util.Utilities
    //#    method: void moveBlogEntriesFromCategory(Blog, Category, Category)
    //#    unanalyzed callee: Date net.sourceforge.pebble.domain.BlogEntry:getDate()
    //#utilities.java:210: Warning: method not available
    //#    -- call on void org.apache.commons.logging.Log:info(Object)
    //#    severity: INFORMATIONAL
    //#    class: net.sourceforge.pebble.util.Utilities
    //#    method: void moveBlogEntriesFromCategory(Blog, Category, Category)
    //#    unanalyzed callee: void org.apache.commons.logging.Log:info(Object)
        }
      }
    }
  }
    //#utilities.java:214: end of method: void net.sourceforge.pebble.util.Utilities.moveBlogEntriesFromCategory(Blog, Category, Category)

  /**
   * Resets the theme of a blog to "default".
   */
  public static void resetTheme(Blog blog) {
    log.info("Resetting theme to default");
    //#utilities.java:220: method: void net.sourceforge.pebble.util.Utilities.resetTheme(Blog)
    //#utilities.java:220: Warning: method not available
    //#    -- call on void org.apache.commons.logging.Log:info(Object)
    //#    severity: INFORMATIONAL
    //#    class: net.sourceforge.pebble.util.Utilities
    //#    method: void resetTheme(Blog)
    //#    unanalyzed callee: void org.apache.commons.logging.Log:info(Object)
    //#input(void resetTheme(Blog)): blog
    //#input(void resetTheme(Blog)): log
    //#pre[1] (void resetTheme(Blog)): (soft) blog != null
    //#presumption(void resetTheme(Blog)): org.apache.commons.logging.LogFactory:getLog(...)@61 != null
    try {
      blog.removeProperty(Blog.THEME_KEY);
    //#utilities.java:222: Warning: method not available
    //#    -- call on void net.sourceforge.pebble.domain.Blog:removeProperty(String)
    //#    severity: INFORMATIONAL
    //#    class: net.sourceforge.pebble.util.Utilities
    //#    method: void resetTheme(Blog)
    //#    unanalyzed callee: void net.sourceforge.pebble.domain.Blog:removeProperty(String)
      blog.storeProperties();
    //#utilities.java:223: Warning: method not available
    //#    -- call on void net.sourceforge.pebble.domain.Blog:storeProperties()
    //#    severity: INFORMATIONAL
    //#    class: net.sourceforge.pebble.util.Utilities
    //#    method: void resetTheme(Blog)
    //#    unanalyzed callee: void net.sourceforge.pebble.domain.Blog:storeProperties()
    } catch (BlogServiceException e) {
      e.printStackTrace();
    //#utilities.java:225: Warning: method not available
    //#    -- call on void net.sourceforge.pebble.domain.BlogServiceException:printStackTrace()
    //#    severity: INFORMATIONAL
    //#    class: net.sourceforge.pebble.util.Utilities
    //#    method: void resetTheme(Blog)
    //#    unanalyzed callee: void net.sourceforge.pebble.domain.BlogServiceException:printStackTrace()
    }
  }
    //#utilities.java:227: end of method: void net.sourceforge.pebble.util.Utilities.resetTheme(Blog)

  /**
   * Blasts the blog specific theme and overwrites it with the default theme.
   */
  public static void restoreTheme(Blog blog, String themeName) {
    log.info("Restoring theme to " + themeName);
    //#utilities.java:233: method: void net.sourceforge.pebble.util.Utilities.restoreTheme(Blog, String)
    //#utilities.java:233: Warning: method not available
    //#    -- call on void org.apache.commons.logging.Log:info(Object)
    //#    severity: INFORMATIONAL
    //#    class: net.sourceforge.pebble.util.Utilities
    //#    method: void restoreTheme(Blog, String)
    //#    unanalyzed callee: void org.apache.commons.logging.Log:info(Object)
    //#input(void restoreTheme(Blog, String)): blog
    //#input(void restoreTheme(Blog, String)): log
    //#input(void restoreTheme(Blog, String)): themeName
    //#pre[1] (void restoreTheme(Blog, String)): blog != null
    //#presumption(void restoreTheme(Blog, String)): net.sourceforge.pebble.domain.Blog:getEditableTheme(...)@234 != null
    //#presumption(void restoreTheme(Blog, String)): org.apache.commons.logging.LogFactory:getLog(...)@61 != null
    blog.getEditableTheme().restoreToSpecifiedTheme(themeName);
    //#utilities.java:234: Warning: method not available
    //#    -- call on Theme net.sourceforge.pebble.domain.Blog:getEditableTheme()
    //#    severity: INFORMATIONAL
    //#    class: net.sourceforge.pebble.util.Utilities
    //#    method: void restoreTheme(Blog, String)
    //#    unanalyzed callee: Theme net.sourceforge.pebble.domain.Blog:getEditableTheme()
    //#utilities.java:234: Warning: method not available
    //#    -- call on void net.sourceforge.pebble.domain.Theme:restoreToSpecifiedTheme(String)
    //#    severity: INFORMATIONAL
    //#    class: net.sourceforge.pebble.util.Utilities
    //#    method: void restoreTheme(Blog, String)
    //#    unanalyzed callee: void net.sourceforge.pebble.domain.Theme:restoreToSpecifiedTheme(String)
  }
    //#utilities.java:235: end of method: void net.sourceforge.pebble.util.Utilities.restoreTheme(Blog, String)

  /**
   * Resets the plugins back to their defaults.
   */
  public static void resetPlugins(Blog blog) {
    log.info("Resetting plugins to the default configuration");
    //#utilities.java:241: method: void net.sourceforge.pebble.util.Utilities.resetPlugins(Blog)
    //#utilities.java:241: Warning: method not available
    //#    -- call on void org.apache.commons.logging.Log:info(Object)
    //#    severity: INFORMATIONAL
    //#    class: net.sourceforge.pebble.util.Utilities
    //#    method: void resetPlugins(Blog)
    //#    unanalyzed callee: void org.apache.commons.logging.Log:info(Object)
    //#input(void resetPlugins(Blog)): blog
    //#input(void resetPlugins(Blog)): log
    //#pre[1] (void resetPlugins(Blog)): (soft) blog != null
    //#presumption(void resetPlugins(Blog)): org.apache.commons.logging.LogFactory:getLog(...)@61 != null
    try {
      blog.removeProperty(Blog.PERMALINK_PROVIDER_KEY);
    //#utilities.java:243: Warning: method not available
    //#    -- call on void net.sourceforge.pebble.domain.Blog:removeProperty(String)
    //#    severity: INFORMATIONAL
    //#    class: net.sourceforge.pebble.util.Utilities
    //#    method: void resetPlugins(Blog)
    //#    unanalyzed callee: void net.sourceforge.pebble.domain.Blog:removeProperty(String)
      blog.removeProperty(Blog.CONTENT_DECORATORS_KEY);
    //#utilities.java:244: Warning: method not available
    //#    -- call on void net.sourceforge.pebble.domain.Blog:removeProperty(String)
    //#    severity: INFORMATIONAL
    //#    class: net.sourceforge.pebble.util.Utilities
    //#    method: void resetPlugins(Blog)
    //#    unanalyzed callee: void net.sourceforge.pebble.domain.Blog:removeProperty(String)
      blog.removeProperty(Blog.BLOG_LISTENERS_KEY);
    //#utilities.java:245: Warning: method not available
    //#    -- call on void net.sourceforge.pebble.domain.Blog:removeProperty(String)
    //#    severity: INFORMATIONAL
    //#    class: net.sourceforge.pebble.util.Utilities
    //#    method: void resetPlugins(Blog)
    //#    unanalyzed callee: void net.sourceforge.pebble.domain.Blog:removeProperty(String)
      blog.removeProperty(Blog.BLOG_ENTRY_LISTENERS_KEY);
    //#utilities.java:246: Warning: method not available
    //#    -- call on void net.sourceforge.pebble.domain.Blog:removeProperty(String)
    //#    severity: INFORMATIONAL
    //#    class: net.sourceforge.pebble.util.Utilities
    //#    method: void resetPlugins(Blog)
    //#    unanalyzed callee: void net.sourceforge.pebble.domain.Blog:removeProperty(String)
      blog.removeProperty(Blog.COMMENT_LISTENERS_KEY);
    //#utilities.java:247: Warning: method not available
    //#    -- call on void net.sourceforge.pebble.domain.Blog:removeProperty(String)
    //#    severity: INFORMATIONAL
    //#    class: net.sourceforge.pebble.util.Utilities
    //#    method: void resetPlugins(Blog)
    //#    unanalyzed callee: void net.sourceforge.pebble.domain.Blog:removeProperty(String)
      blog.removeProperty(Blog.COMMENT_CONFIRMATION_STRATEGY_KEY);
    //#utilities.java:248: Warning: method not available
    //#    -- call on void net.sourceforge.pebble.domain.Blog:removeProperty(String)
    //#    severity: INFORMATIONAL
    //#    class: net.sourceforge.pebble.util.Utilities
    //#    method: void resetPlugins(Blog)
    //#    unanalyzed callee: void net.sourceforge.pebble.domain.Blog:removeProperty(String)
      blog.removeProperty(Blog.TRACKBACK_LISTENERS_KEY);
    //#utilities.java:249: Warning: method not available
    //#    -- call on void net.sourceforge.pebble.domain.Blog:removeProperty(String)
    //#    severity: INFORMATIONAL
    //#    class: net.sourceforge.pebble.util.Utilities
    //#    method: void resetPlugins(Blog)
    //#    unanalyzed callee: void net.sourceforge.pebble.domain.Blog:removeProperty(String)
      blog.removeProperty(Blog.TRACKBACK_CONFIRMATION_STRATEGY_KEY);
    //#utilities.java:250: Warning: method not available
    //#    -- call on void net.sourceforge.pebble.domain.Blog:removeProperty(String)
    //#    severity: INFORMATIONAL
    //#    class: net.sourceforge.pebble.util.Utilities
    //#    method: void resetPlugins(Blog)
    //#    unanalyzed callee: void net.sourceforge.pebble.domain.Blog:removeProperty(String)
      blog.removeProperty(Blog.LUCENE_ANALYZER_KEY);
    //#utilities.java:251: Warning: method not available
    //#    -- call on void net.sourceforge.pebble.domain.Blog:removeProperty(String)
    //#    severity: INFORMATIONAL
    //#    class: net.sourceforge.pebble.util.Utilities
    //#    method: void resetPlugins(Blog)
    //#    unanalyzed callee: void net.sourceforge.pebble.domain.Blog:removeProperty(String)
      blog.removeProperty(Blog.LOGGER_KEY);
    //#utilities.java:252: Warning: method not available
    //#    -- call on void net.sourceforge.pebble.domain.Blog:removeProperty(String)
    //#    severity: INFORMATIONAL
    //#    class: net.sourceforge.pebble.util.Utilities
    //#    method: void resetPlugins(Blog)
    //#    unanalyzed callee: void net.sourceforge.pebble.domain.Blog:removeProperty(String)
      blog.storeProperties();
    //#utilities.java:253: Warning: method not available
    //#    -- call on void net.sourceforge.pebble.domain.Blog:storeProperties()
    //#    severity: INFORMATIONAL
    //#    class: net.sourceforge.pebble.util.Utilities
    //#    method: void resetPlugins(Blog)
    //#    unanalyzed callee: void net.sourceforge.pebble.domain.Blog:storeProperties()
    } catch (BlogServiceException e) {
      e.printStackTrace();
    //#utilities.java:255: Warning: method not available
    //#    -- call on void net.sourceforge.pebble.domain.BlogServiceException:printStackTrace()
    //#    severity: INFORMATIONAL
    //#    class: net.sourceforge.pebble.util.Utilities
    //#    method: void resetPlugins(Blog)
    //#    unanalyzed callee: void net.sourceforge.pebble.domain.BlogServiceException:printStackTrace()
    }
  }
    //#utilities.java:257: end of method: void net.sourceforge.pebble.util.Utilities.resetPlugins(Blog)

  /**
   * Moves blog entries from one category to another.
   *
   * @param blog    a Blog instance
   */
  public static void restructureBlogToGMT(Blog blog) {
    log.info("Restructuring blog entries into GMT directory hierarchy");
    //#utilities.java:265: method: void net.sourceforge.pebble.util.Utilities.restructureBlogToGMT(Blog)
    //#utilities.java:265: Warning: method not available
    //#    -- call on void org.apache.commons.logging.Log:info(Object)
    //#    severity: INFORMATIONAL
    //#    class: net.sourceforge.pebble.util.Utilities
    //#    method: void restructureBlogToGMT(Blog)
    //#    unanalyzed callee: void org.apache.commons.logging.Log:info(Object)
    //#input(void restructureBlogToGMT(Blog)): blog
    //#input(void restructureBlogToGMT(Blog)): log
    //#pre[1] (void restructureBlogToGMT(Blog)): blog != null
    //#presumption(void restructureBlogToGMT(Blog)): Local_13[Local_11]@271 != null
    //#presumption(void restructureBlogToGMT(Blog)): Local_18[Local_16]@273 != null
    //#presumption(void restructureBlogToGMT(Blog)): Local_23[Local_21]@275 != null
    //#presumption(void restructureBlogToGMT(Blog)): Local_8[Local_6]@269 != null
    //#presumption(void restructureBlogToGMT(Blog)): blogEntryFiles.length@275 <= 4_294_967_295
    //#presumption(void restructureBlogToGMT(Blog)): days.length@273 <= 4_294_967_295
    //#presumption(void restructureBlogToGMT(Blog)): java.io.File:getName(...)@277 != null
    //#presumption(void restructureBlogToGMT(Blog)): java.io.File:listFiles(...)@269 != null
    //#presumption(void restructureBlogToGMT(Blog)): java.io.File:listFiles(...)@271 != null
    //#presumption(void restructureBlogToGMT(Blog)): java.io.File:listFiles(...)@273 != null
    //#presumption(void restructureBlogToGMT(Blog)): java.io.File:listFiles(...)@275 != null
    //#presumption(void restructureBlogToGMT(Blog)): months.length@271 <= 4_294_967_295
    //#presumption(void restructureBlogToGMT(Blog)): org.apache.commons.logging.LogFactory:getLog(...)@61 != null
    //#presumption(void restructureBlogToGMT(Blog)): years.length@269 <= 4_294_967_295
    //#test_vector(void restructureBlogToGMT(Blog)): java.io.File:equals(...)@283: {1}, {0}
    TimeZone gmt = TimeZone.getTimeZone("GMT");
    FileBlogEntryDAO dao = new FileBlogEntryDAO();
    //#utilities.java:267: Warning: method not available
    //#    -- call on void net.sourceforge.pebble.dao.file.FileBlogEntryDAO()
    //#    severity: INFORMATIONAL
    //#    class: net.sourceforge.pebble.util.Utilities
    //#    method: void restructureBlogToGMT(Blog)
    //#    unanalyzed callee: void net.sourceforge.pebble.dao.file.FileBlogEntryDAO()
    File root = new File(blog.getRoot());
    //#utilities.java:268: Warning: method not available
    //#    -- call on String net.sourceforge.pebble.domain.Blog:getRoot()
    //#    severity: INFORMATIONAL
    //#    class: net.sourceforge.pebble.util.Utilities
    //#    method: void restructureBlogToGMT(Blog)
    //#    unanalyzed callee: String net.sourceforge.pebble.domain.Blog:getRoot()
    File years[] = root.listFiles(new FourDigitFilenameFilter());
    //#utilities.java:269: Warning: method not available
    //#    -- call on void net.sourceforge.pebble.dao.file.FourDigitFilenameFilter()
    //#    severity: INFORMATIONAL
    //#    class: net.sourceforge.pebble.util.Utilities
    //#    method: void restructureBlogToGMT(Blog)
    //#    unanalyzed callee: void net.sourceforge.pebble.dao.file.FourDigitFilenameFilter()
    for (File year : years) {
      File months[] = year.listFiles(new TwoDigitFilenameFilter());
    //#utilities.java:271: Warning: method not available
    //#    -- call on void net.sourceforge.pebble.dao.file.TwoDigitFilenameFilter()
    //#    severity: INFORMATIONAL
    //#    class: net.sourceforge.pebble.util.Utilities
    //#    method: void restructureBlogToGMT(Blog)
    //#    unanalyzed callee: void net.sourceforge.pebble.dao.file.TwoDigitFilenameFilter()
      for (File month : months) {
        File days[] = month.listFiles(new TwoDigitFilenameFilter());
    //#utilities.java:273: Warning: method not available
    //#    -- call on void net.sourceforge.pebble.dao.file.TwoDigitFilenameFilter()
    //#    severity: INFORMATIONAL
    //#    class: net.sourceforge.pebble.util.Utilities
    //#    method: void restructureBlogToGMT(Blog)
    //#    unanalyzed callee: void net.sourceforge.pebble.dao.file.TwoDigitFilenameFilter()
        for (File day : days) {
          File blogEntryFiles[] = day.listFiles(new BlogEntryFilenameFilter());
    //#utilities.java:275: Warning: method not available
    //#    -- call on void net.sourceforge.pebble.dao.file.BlogEntryFilenameFilter()
    //#    severity: INFORMATIONAL
    //#    class: net.sourceforge.pebble.util.Utilities
    //#    method: void restructureBlogToGMT(Blog)
    //#    unanalyzed callee: void net.sourceforge.pebble.dao.file.BlogEntryFilenameFilter()
          for (File blogEntryFile : blogEntryFiles) {
            String filename = blogEntryFile.getName();
            String id = filename.substring(0, filename.indexOf('.'));
            File oldFile = blogEntryFile;
            File newDirectory = new File(dao.getPath(blog, id, gmt));
    //#utilities.java:280: Warning: method not available
    //#    -- call on String net.sourceforge.pebble.dao.file.FileBlogEntryDAO:getPath(Blog, String, TimeZone)
    //#    severity: INFORMATIONAL
    //#    class: net.sourceforge.pebble.util.Utilities
    //#    method: void restructureBlogToGMT(Blog)
    //#    unanalyzed callee: String net.sourceforge.pebble.dao.file.FileBlogEntryDAO:getPath(Blog, String, TimeZone)
            File newFile = new File(newDirectory, filename);

            if (!oldFile.equals(newFile)) {
              log.info("Moving " + id + " to " + newFile.getAbsolutePath() + " from " + oldFile.getAbsolutePath());
    //#utilities.java:284: Warning: method not available
    //#    -- call on void org.apache.commons.logging.Log:info(Object)
    //#    severity: INFORMATIONAL
    //#    class: net.sourceforge.pebble.util.Utilities
    //#    method: void restructureBlogToGMT(Blog)
    //#    unanalyzed callee: void org.apache.commons.logging.Log:info(Object)
              newDirectory.mkdirs();
              oldFile.renameTo(newFile);
            }
          }
        }
      }
    }
  }
    //#utilities.java:292: end of method: void net.sourceforge.pebble.util.Utilities.restructureBlogToGMT(Blog)

  /**
   * Restructures how static pages are stored on disk.
   *
   * @param blog    a Blog instance
   */
  public static void restructureStaticPages(Blog blog) {
    log.info("Restructuring static pages");
    //#utilities.java:300: method: void net.sourceforge.pebble.util.Utilities.restructureStaticPages(Blog)
    //#utilities.java:300: Warning: method not available
    //#    -- call on void org.apache.commons.logging.Log:info(Object)
    //#    severity: INFORMATIONAL
    //#    class: net.sourceforge.pebble.util.Utilities
    //#    method: void restructureStaticPages(Blog)
    //#    unanalyzed callee: void org.apache.commons.logging.Log:info(Object)
    //#input(void restructureStaticPages(Blog)): blog
    //#input(void restructureStaticPages(Blog)): log
    //#pre[1] (void restructureStaticPages(Blog)): blog != null
    //#presumption(void restructureStaticPages(Blog)): Local_6[Local_4]@307 != null
    //#presumption(void restructureStaticPages(Blog)): files.length@307 <= 4_294_967_295
    //#presumption(void restructureStaticPages(Blog)): java.io.File:getName(...)@314 != null
    //#presumption(void restructureStaticPages(Blog)): java.io.File:getName(...)@315 != null
    //#presumption(void restructureStaticPages(Blog)): java.io.File:getName(...)@315 != null
    //#presumption(void restructureStaticPages(Blog)): java.io.File:getName(...)@324 != null
    //#presumption(void restructureStaticPages(Blog)): java.io.File:getName(...)@324 != null
    //#presumption(void restructureStaticPages(Blog)): java.io.File:getName(...)@331 != null
    //#presumption(void restructureStaticPages(Blog)): java.io.File:getName(...)@331 != null
    //#presumption(void restructureStaticPages(Blog)): java.io.File:listFiles(...)@307 != null
    //#presumption(void restructureStaticPages(Blog)): org.apache.commons.logging.LogFactory:getLog(...)@61 != null
    //#test_vector(void restructureStaticPages(Blog)): java.io.File:exists(...)@316: {1}, {0}
    //#test_vector(void restructureStaticPages(Blog)): java.io.File:exists(...)@325: {1}, {0}
    //#test_vector(void restructureStaticPages(Blog)): java.io.File:isDirectory(...)@303: {1}, {0}
    //#test_vector(void restructureStaticPages(Blog)): java.lang.String:endsWith(...)@314: {0}, {1}
    File root = new File(blog.getRoot(), "pages");
    //#utilities.java:301: Warning: method not available
    //#    -- call on String net.sourceforge.pebble.domain.Blog:getRoot()
    //#    severity: INFORMATIONAL
    //#    class: net.sourceforge.pebble.util.Utilities
    //#    method: void restructureStaticPages(Blog)
    //#    unanalyzed callee: String net.sourceforge.pebble.domain.Blog:getRoot()
    // Upon first start this directory does not exist yet 
    if(!root.isDirectory()) {
    	root.mkdir();
    }

    File files[] = root.listFiles(new FilenameFilter() {
    //#utilities.java:307: method: void net.sourceforge.pebble.util.Utilities$1.net.sourceforge.pebble.util.Utilities$1()
    //#utilities.java:307: end of method: void net.sourceforge.pebble.util.Utilities$1.net.sourceforge.pebble.util.Utilities$1()
        public boolean accept(File dir, String name) {
          return name.matches("(\\d+\\.xml)|(\\d+\\.xml\\.bak)");
    //#utilities.java:309: method: bool net.sourceforge.pebble.util.Utilities$1.accept(File, String)
    //#input(bool accept(File, String)): name
    //#output(bool accept(File, String)): return_value
    //#pre[1] (bool accept(File, String)): name != null
    //#post(bool accept(File, String)): init'ed(return_value)
    //#utilities.java:309: end of method: bool net.sourceforge.pebble.util.Utilities$1.accept(File, String)
        }
    });

    for (File file : files) {
      if (file.getName().endsWith(".xml")) {
        File staticPageDirectory = new File(root, file.getName().substring(0, file.getName().indexOf(".xml")));
        if (!staticPageDirectory.exists()) {
          log.info("Creating static page directory at " + staticPageDirectory.getAbsolutePath());
    //#utilities.java:317: Warning: method not available
    //#    -- call on void org.apache.commons.logging.Log:info(Object)
    //#    severity: INFORMATIONAL
    //#    class: net.sourceforge.pebble.util.Utilities
    //#    method: void restructureStaticPages(Blog)
    //#    unanalyzed callee: void org.apache.commons.logging.Log:info(Object)
          staticPageDirectory.mkdir();
        }
        File destination = new File(staticPageDirectory, file.getName());
        log.info("Moving " + file.getAbsolutePath() + " to " + destination.getAbsolutePath());
    //#utilities.java:321: Warning: method not available
    //#    -- call on void org.apache.commons.logging.Log:info(Object)
    //#    severity: INFORMATIONAL
    //#    class: net.sourceforge.pebble.util.Utilities
    //#    method: void restructureStaticPages(Blog)
    //#    unanalyzed callee: void org.apache.commons.logging.Log:info(Object)
        file.renameTo(destination);
      } else {
        File staticPageDirectory = new File(root, file.getName().substring(0, file.getName().indexOf(".xml")));
        if (!staticPageDirectory.exists()) {
          log.info("Creating static page directory at " + staticPageDirectory.getAbsolutePath());
    //#utilities.java:326: Warning: method not available
    //#    -- call on void org.apache.commons.logging.Log:info(Object)
    //#    severity: INFORMATIONAL
    //#    class: net.sourceforge.pebble.util.Utilities
    //#    method: void restructureStaticPages(Blog)
    //#    unanalyzed callee: void org.apache.commons.logging.Log:info(Object)
          staticPageDirectory.mkdir();
        }
        SimpleDateFormat archiveFileExtension = new SimpleDateFormat("yyyyMMdd-HHmmss");
        archiveFileExtension.setTimeZone(blog.getTimeZone());
    //#utilities.java:330: Warning: method not available
    //#    -- call on TimeZone net.sourceforge.pebble.domain.Blog:getTimeZone()
    //#    severity: INFORMATIONAL
    //#    class: net.sourceforge.pebble.util.Utilities
    //#    method: void restructureStaticPages(Blog)
    //#    unanalyzed callee: TimeZone net.sourceforge.pebble.domain.Blog:getTimeZone()
        File destination = new File(staticPageDirectory, file.getName().substring(0, file.getName().length()-3) + archiveFileExtension.format(new Date(file.lastModified())));
        log.info("Moving " + file.getAbsolutePath() + " to " + destination.getAbsolutePath());
    //#utilities.java:332: Warning: method not available
    //#    -- call on void org.apache.commons.logging.Log:info(Object)
    //#    severity: INFORMATIONAL
    //#    class: net.sourceforge.pebble.util.Utilities
    //#    method: void restructureStaticPages(Blog)
    //#    unanalyzed callee: void org.apache.commons.logging.Log:info(Object)
        file.renameTo(destination);
      }
    }
  }
    //#utilities.java:336: end of method: void net.sourceforge.pebble.util.Utilities.restructureStaticPages(Blog)

  public static void main(String[] args) throws Exception {
    if (args.length != 2) {
    //#utilities.java:339: method: void net.sourceforge.pebble.util.Utilities.main(String[])
    //#input(void main(String[])): args
    //#input(void main(String[])): args.length
    //#input(void main(String[])): args[0]
    //#input(void main(String[])): args[1]
    //#input(void main(String[])): java.lang.System.out
    //#input(void main(String[])): log
    //#pre[2] (void main(String[])): args != null
    //#pre[4] (void main(String[])): (soft) init'ed(args[0])
    //#pre[5] (void main(String[])): (soft) init'ed(args[1])
    //#presumption(void main(String[])): java.lang.System.out != null
    //#unanalyzed(void main(String[])): Effects-of-calling:org.apache.commons.logging.Log:info
    //#unanalyzed(void main(String[])): Effects-of-calling:net.sourceforge.pebble.domain.Blog:reindex
    //#unanalyzed(void main(String[])): Effects-of-calling:net.sourceforge.pebble.domain.Blog:getBlogEntries
    //#unanalyzed(void main(String[])): Effects-of-calling:java.util.List:iterator
    //#unanalyzed(void main(String[])): Effects-of-calling:net.sourceforge.pebble.event.response.IpAddressListener
    //#unanalyzed(void main(String[])): Effects-of-calling:java.util.Iterator:hasNext
    //#unanalyzed(void main(String[])): Effects-of-calling:java.util.Iterator:next
    //#unanalyzed(void main(String[])): Effects-of-calling:java.lang.StringBuilder
    //#unanalyzed(void main(String[])): Effects-of-calling:net.sourceforge.pebble.domain.BlogEntry:getTitle
    //#unanalyzed(void main(String[])): Effects-of-calling:java.lang.StringBuilder:append
    //#unanalyzed(void main(String[])): Effects-of-calling:net.sourceforge.pebble.domain.BlogEntry:getDate
    //#unanalyzed(void main(String[])): Effects-of-calling:java.lang.StringBuilder:toString
    //#unanalyzed(void main(String[])): Effects-of-calling:net.sourceforge.pebble.domain.BlogEntry:getComments
    //#unanalyzed(void main(String[])): Effects-of-calling:net.sourceforge.pebble.domain.Comment:isApproved
    //#unanalyzed(void main(String[])): Effects-of-calling:net.sourceforge.pebble.api.event.comment.CommentEvent
    //#unanalyzed(void main(String[])): Effects-of-calling:net.sourceforge.pebble.event.response.IpAddressListener:commentApproved
    //#unanalyzed(void main(String[])): Effects-of-calling:net.sourceforge.pebble.domain.Comment:isRejected
    //#unanalyzed(void main(String[])): Effects-of-calling:net.sourceforge.pebble.event.response.IpAddressListener:commentRejected
    //#unanalyzed(void main(String[])): Effects-of-calling:net.sourceforge.pebble.domain.BlogEntry:getTrackBacks
    //#unanalyzed(void main(String[])): Effects-of-calling:net.sourceforge.pebble.domain.TrackBack:isApproved
    //#unanalyzed(void main(String[])): Effects-of-calling:net.sourceforge.pebble.api.event.trackback.TrackBackEvent
    //#unanalyzed(void main(String[])): Effects-of-calling:net.sourceforge.pebble.event.response.IpAddressListener:trackBackApproved
    //#unanalyzed(void main(String[])): Effects-of-calling:net.sourceforge.pebble.domain.TrackBack:isRejected
    //#unanalyzed(void main(String[])): Effects-of-calling:net.sourceforge.pebble.event.response.IpAddressListener:trackBackRejected
    //#unanalyzed(void main(String[])): Effects-of-calling:net.sourceforge.pebble.domain.Comment:getBody
    //#unanalyzed(void main(String[])): Effects-of-calling:java.lang.String:replaceAll
    //#unanalyzed(void main(String[])): Effects-of-calling:net.sourceforge.pebble.domain.Comment:setBody
    //#unanalyzed(void main(String[])): Effects-of-calling:net.sourceforge.pebble.domain.TrackBack:getExcerpt
    //#unanalyzed(void main(String[])): Effects-of-calling:net.sourceforge.pebble.domain.TrackBack:setExcerpt
    //#unanalyzed(void main(String[])): Effects-of-calling:net.sourceforge.pebble.domain.BlogService
    //#unanalyzed(void main(String[])): Effects-of-calling:net.sourceforge.pebble.domain.BlogService:putBlogEntry
    //#unanalyzed(void main(String[])): Effects-of-calling:org.apache.commons.logging.Log:error
    //#unanalyzed(void main(String[])): Effects-of-calling:java.util.Properties
    //#unanalyzed(void main(String[])): Effects-of-calling:net.sourceforge.pebble.domain.Blog:getRoot
    //#unanalyzed(void main(String[])): Effects-of-calling:java.io.File
    //#unanalyzed(void main(String[])): Effects-of-calling:java.io.FileInputStream
    //#unanalyzed(void main(String[])): Effects-of-calling:java.util.Properties:load
    //#unanalyzed(void main(String[])): Effects-of-calling:java.io.FileInputStream:close
    //#unanalyzed(void main(String[])): Effects-of-calling:java.util.Properties:keySet
    //#unanalyzed(void main(String[])): Effects-of-calling:java.util.Set:iterator
    //#unanalyzed(void main(String[])): Effects-of-calling:java.util.Properties:getProperty
    //#unanalyzed(void main(String[])): Effects-of-calling:java.lang.String:startsWith
    //#unanalyzed(void main(String[])): Effects-of-calling:net.sourceforge.pebble.domain.Category
    //#unanalyzed(void main(String[])): Effects-of-calling:net.sourceforge.pebble.domain.Blog:addCategory
    //#unanalyzed(void main(String[])): Effects-of-calling:net.sourceforge.pebble.dao.DAOFactory:getConfiguredFactory
    //#unanalyzed(void main(String[])): Effects-of-calling:net.sourceforge.pebble.dao.DAOFactory:getCategoryDAO
    //#unanalyzed(void main(String[])): Effects-of-calling:net.sourceforge.pebble.dao.CategoryDAO:addCategory
    //#test_vector(void main(String[])): args.length: {2}, {0,1, 3..+Inf}
    //#test_vector(void main(String[])): args[1]: Addr_Set{null}, Inverse{null}
    //#test_vector(void main(String[])): java.lang.String:equalsIgnoreCase(...)@353: {0}, {1}
    //#test_vector(void main(String[])): java.lang.String:equalsIgnoreCase(...)@355: {0}, {1}
    //#test_vector(void main(String[])): java.lang.String:equalsIgnoreCase(...)@357: {0}, {1}
    //#test_vector(void main(String[])): java.lang.String:equalsIgnoreCase(...)@359: {0}, {1}
      System.out.println("Usage : pebble.util.Utilities %1 %2");
      System.out.println("   %1 : location of Pebble blog");
      System.out.println("   %2 : [ipAddressListener|fixHtmlInResponses|convertCategories]");

      return;
    }

    DAOFactory.setConfiguredFactory(new FileDAOFactory());
    //#utilities.java:347: Warning: method not available
    //#    -- call on void net.sourceforge.pebble.dao.file.FileDAOFactory()
    //#    severity: INFORMATIONAL
    //#    class: net.sourceforge.pebble.util.Utilities
    //#    method: void main(String[])
    //#    unanalyzed callee: void net.sourceforge.pebble.dao.file.FileDAOFactory()
    //#utilities.java:347: Warning: method not available
    //#    -- call on void net.sourceforge.pebble.dao.DAOFactory:setConfiguredFactory(DAOFactory)
    //#    severity: INFORMATIONAL
    //#    class: net.sourceforge.pebble.util.Utilities
    //#    method: void main(String[])
    //#    unanalyzed callee: void net.sourceforge.pebble.dao.DAOFactory:setConfiguredFactory(DAOFactory)
    Blog blog = new Blog(args[0]);
    //#utilities.java:348: Warning: method not available
    //#    -- call on void net.sourceforge.pebble.domain.Blog(String)
    //#    severity: INFORMATIONAL
    //#    class: net.sourceforge.pebble.util.Utilities
    //#    method: void main(String[])
    //#    unanalyzed callee: void net.sourceforge.pebble.domain.Blog(String)

    String action = args[1];
    if (action == null) {
      // do nothing
    } else if (action.equalsIgnoreCase("ipAddressListener")) {
      buildIpAddressLists(blog);
    } else if (action.equalsIgnoreCase("fixHtmlInResponses")) {
      fixHtmlInResponses(blog);
    } else if (action.equalsIgnoreCase("buildIndexes")) {
      buildIndexes(blog);
    } else if (action.equalsIgnoreCase("convertCategories")) {
      convertCategories(blog);
    }

  }
    //#utilities.java:363: end of method: void net.sourceforge.pebble.util.Utilities.main(String[])
  /**
   * this is a very simple way to honor https transfer. As
   * the frontend depends upon setting a base url in the html/head block, it
   * should at least contain the https scheme if the current page has been
   * requested through https. 
   * If there is no https involved, pebbles previous behaviour 
   * (as of version 2.3.1) does not change. This change implies also changing 
   * several frontend jsps WEB-INF/tags/page.tag to use the value calculated
   * here instead of ${blog.url}. In the context of the patch that introduced
   * this method, the values have been named ${blogUrl} and ${multiBlogUrl}

   * @param currentScheme the scheme the current request has been sent through (e.g. request.getScheme())
   * @param blogUrl the ordinary blog url that might be changed to the secure one.
   * @return value to be used as base url for the blog named in blogUrl
   */
  public static String calcBaseUrl(String currentScheme, String blogUrl) {
  	Configuration configuration = PebbleContext.getInstance().getConfiguration();
    //#utilities.java:380: method: String net.sourceforge.pebble.util.Utilities.calcBaseUrl(String, String)
    //#input(String calcBaseUrl(String, String)): blogUrl
    //#input(String calcBaseUrl(String, String)): currentScheme
    //#input(String calcBaseUrl(String, String)): net.sourceforge.pebble.PebbleContext__static_init.new PebbleContext(PebbleContext__static_init#1).__Tag
    //#input(String calcBaseUrl(String, String)): net.sourceforge.pebble.PebbleContext__static_init.new PebbleContext(PebbleContext__static_init#1).configuration
    //#input(String calcBaseUrl(String, String)): net/sourceforge/pebble/PebbleContext.__Descendant_Table[net/sourceforge/pebble/PebbleContext]
    //#input(String calcBaseUrl(String, String)): net/sourceforge/pebble/PebbleContext.__Dispatch_Table.getConfiguration()Lnet/sourceforge/pebble/Configuration;
    //#input(String calcBaseUrl(String, String)): net/sourceforge/pebble/PebbleContext.instance
    //#output(String calcBaseUrl(String, String)): return_value
    //#pre[1] (String calcBaseUrl(String, String)): (soft) blogUrl != null
    //#pre[3] (String calcBaseUrl(String, String)): (soft) net.sourceforge.pebble.PebbleContext__static_init.new PebbleContext(PebbleContext__static_init#1).configuration != null
    //#presumption(String calcBaseUrl(String, String)): net.sourceforge.pebble.Configuration:getSecureUrl(...)@381 != null
    //#post(String calcBaseUrl(String, String)): return_value != null
    //#test_vector(String calcBaseUrl(String, String)): java.lang.String:equals(...)@381: {0}, {1}
    //#test_vector(String calcBaseUrl(String, String)): java.lang.String:startsWith(...)@381: {0}, {1}
  	if ("https".equals(currentScheme) && configuration.getSecureUrl().startsWith("https")) {
    //#utilities.java:381: Warning: method not available
    //#    -- call on String net.sourceforge.pebble.Configuration:getSecureUrl()
    //#    severity: INFORMATIONAL
    //#    class: net.sourceforge.pebble.util.Utilities
    //#    method: String calcBaseUrl(String, String)
    //#    unanalyzed callee: String net.sourceforge.pebble.Configuration:getSecureUrl()
		return blogUrl.replace(configuration.getUrl(), configuration.getSecureUrl());
    //#utilities.java:382: Warning: method not available
    //#    -- call on String net.sourceforge.pebble.Configuration:getUrl()
    //#    severity: INFORMATIONAL
    //#    class: net.sourceforge.pebble.util.Utilities
    //#    method: String calcBaseUrl(String, String)
    //#    unanalyzed callee: String net.sourceforge.pebble.Configuration:getUrl()
    //#utilities.java:382: Warning: method not available
    //#    -- call on String net.sourceforge.pebble.Configuration:getSecureUrl()
    //#    severity: INFORMATIONAL
    //#    class: net.sourceforge.pebble.util.Utilities
    //#    method: String calcBaseUrl(String, String)
    //#    unanalyzed callee: String net.sourceforge.pebble.Configuration:getSecureUrl()
	} 
  	return blogUrl;
    //#utilities.java:384: end of method: String net.sourceforge.pebble.util.Utilities.calcBaseUrl(String, String)
  }

}    //#output(net.sourceforge.pebble.util.Utilities$1__static_init): __Descendant_Table[net/sourceforge/pebble/util/Utilities$1]
    //#output(net.sourceforge.pebble.util.Utilities$1__static_init): __Dispatch_Table.accept(Ljava/io/File;Ljava/lang/String;)Z
    //#post(net.sourceforge.pebble.util.Utilities$1__static_init): __Descendant_Table[net/sourceforge/pebble/util/Utilities$1] == &__Dispatch_Table
    //#post(net.sourceforge.pebble.util.Utilities$1__static_init): __Dispatch_Table.accept(Ljava/io/File;Ljava/lang/String;)Z == &accept
    //#utilities.java:: end of method: net.sourceforge.pebble.util.Utilities$1.net.sourceforge.pebble.util.Utilities$1__static_init
    //#utilities.java:: end of class: net.sourceforge.pebble.util.Utilities$1
    //#utilities.java:: end of class: net.sourceforge.pebble.util.Utilities
