|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.fosstrak.hal.util.Tools
public class Tools
Collection of usefull methods needed by several servlets.
| Constructor Summary | |
|---|---|
Tools()
|
|
| Method Summary | |
|---|---|
static java.lang.String |
convertHtmlToText(java.lang.String text)
converts HTML to a string. |
static java.util.Hashtable |
convertTableToHTML(java.util.Hashtable table)
converts the values of the keys of the given hashtable to HTML. |
static java.util.Hashtable |
convertTableToText(java.util.Hashtable table)
converts the values of the keys of the given hashtable from HTML to text. |
static java.lang.String |
convertTextToHtml(java.lang.String text)
converts the string to HTML, i.e. replaces newline with tag. |
static java.lang.String |
decodeURL(java.lang.String string)
decodes a URL encoded string. |
static java.lang.String |
encodeURL(java.lang.String string)
encodes a string in URL encoding. |
static java.lang.String |
getKeyValuePairs(java.util.Hashtable table)
returns a string that contains all the key-value pairs of the given hashtable. |
static java.util.Date |
getTime()
returns the current date and time. |
static java.util.Vector |
getTokens(java.lang.String list)
returns a vector of strings that are the tokens of the original string delimeted by whitespaces. |
static boolean |
isValidName(java.lang.String name)
checks if a string is a valid Chat file name |
static java.lang.String |
readFile(java.lang.String filename)
reads the content of a text file into a string. |
static java.lang.String |
replaceString(java.lang.String text,
java.lang.String searchFor,
java.lang.String replaceBy)
replaces the string xx in the text by the string yy. |
static java.lang.String |
replaceStrings(java.lang.String text,
java.util.Hashtable table)
replaces the keys of the given hashtable in the text by the values. |
static void |
writeFile(java.lang.String filename,
java.lang.String text)
writes the content of a string to a file. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public Tools()
| Method Detail |
|---|
public static java.lang.String replaceStrings(java.lang.String text,
java.util.Hashtable table)
text - the text containing strings to be replacedtable - the hashtable containing the key-value pairs for the replacement
public static java.lang.String replaceString(java.lang.String text,
java.lang.String searchFor,
java.lang.String replaceBy)
text - the text containing strings to be replacedsearchFor - string to be replaced by replaceByreplaceBy - string that will replace searchFor
public static java.util.Vector getTokens(java.lang.String list)
list - the string to be tokenized.
public static java.lang.String readFile(java.lang.String filename)
throws java.io.IOException
filename - the filename of the file.
java.io.IOException
public static void writeFile(java.lang.String filename,
java.lang.String text)
throws java.io.IOException
filename - the filename of the file.text - the string to be written to the file.
java.io.IOExceptionpublic static java.util.Hashtable convertTableToHTML(java.util.Hashtable table)
table - the hashtable containing the key-value pairs
public static java.lang.String convertTextToHtml(java.lang.String text)
text - the string to be converted
public static java.util.Hashtable convertTableToText(java.util.Hashtable table)
table - the hashtable containing the key-value pairs
public static java.lang.String convertHtmlToText(java.lang.String text)
tags are replaced with newline.
text - the html text to be converted
public static java.lang.String getKeyValuePairs(java.util.Hashtable table)
table - the hashtable containing the key-value pairs
public static java.util.Date getTime()
public static java.lang.String encodeURL(java.lang.String string)
string - the original string.
public static java.lang.String decodeURL(java.lang.String string)
string - the URL encoded string
public static boolean isValidName(java.lang.String name)
name - the string to test
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||