jimm.twice.util
Class HttpUtils

java.lang.Object
  extended byjimm.twice.util.HttpUtils

public class HttpUtils
extends java.lang.Object

Contains static utility methods useful when dealing with HTTP and HTML.

Author:
Jim Menard, jimm@io.com

Constructor Summary
HttpUtils()
           
 
Method Summary
static java.lang.String escape(java.lang.String str)
          Returns a string that has all HTML special characters escaped.
static java.lang.String escape(java.lang.String str, boolean addLineBreaks)
          Returns a string that has all HTML special characters escaped and optionally adds "<br/>" line breaks after every ">" that appears in the input string.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HttpUtils

public HttpUtils()
Method Detail

escape

public static java.lang.String escape(java.lang.String str)
Returns a string that has all HTML special characters escaped.

Parameters:
str - a string
Returns:
a new string with all HTML special characters escaped

escape

public static java.lang.String escape(java.lang.String str,
                                      boolean addLineBreaks)
Returns a string that has all HTML special characters escaped and optionally adds "<br/>" line breaks after every ">" that appears in the input string.

Parameters:
str - a string
addLineBreaks - if true, we add "<br/>" after every ">" found in the input
Returns:
a new string with all HTML special characters escaped and, if requested, "<br/>" tags after every ">"