Jwma

dtw.webmail.util
Class StringUtil

java.lang.Object
  |
  +--dtw.webmail.util.StringUtil

public class StringUtil
extends java.lang.Object

Class that contains static utility methods to handle Strings.

Version:
0.9.7 07/02/2003
Author:
Dieter Wimberger

Field Summary
static java.text.SimpleDateFormat DEFAULT_DATEFORMAT
          Defines a simple date format, to be used for returning the formatted date.
 
Constructor Summary
StringUtil()
           
 
Method Summary
static boolean contains(java.lang.String[] strs, java.lang.String str)
           
static java.lang.String getFormattedDate()
          Returns now, as String formatted with DEFAULT_DATEFORMAT.
static java.lang.String join(java.lang.String[] items, java.lang.String delim)
          Method that joins an array of strings into a string with delimited fields
static java.lang.String repairPath(java.lang.String path)
          This method is used to circumvent a bug (or feature) in the URLClassLoader, which prevents it from being able to use file url's with path strings which contain a .. Example: /usr/local/tomcat/bin/../webapps/webmail/WEB-INF/i18n/ does not properly work, whereas /usr/local/tomcat/webapps/webmail/WEB-INF/i18n/ which represents the same (for the File class it makes no difference whatsoever), but works.
static java.lang.String[] split(java.lang.String str, java.lang.String delim)
          Method that splits a string with delimited fields into an array of strings.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_DATEFORMAT

public static java.text.SimpleDateFormat DEFAULT_DATEFORMAT
Defines a simple date format, to be used for returning the formatted date.

Constructor Detail

StringUtil

public StringUtil()
Method Detail

split

public static java.lang.String[] split(java.lang.String str,
                                       java.lang.String delim)
Method that splits a string with delimited fields into an array of strings.

Parameters:
str - String with delimited fields.
delim - String that represents the delimiter.
Returns:
the String[] that contains all splitted fields.

join

public static java.lang.String join(java.lang.String[] items,
                                    java.lang.String delim)
Method that joins an array of strings into a string with delimited fields

Parameters:
items - an array of strings.
delim - String that represents the delimiter.
Returns:
the String that contains the delimited list.

repairPath

public static java.lang.String repairPath(java.lang.String path)
This method is used to circumvent a bug (or feature) in the URLClassLoader, which prevents it from being able to use file url's with path strings which contain a .. Example: /usr/local/tomcat/bin/../webapps/webmail/WEB-INF/i18n/ does not properly work, whereas /usr/local/tomcat/webapps/webmail/WEB-INF/i18n/ which represents the same (for the File class it makes no difference whatsoever), but works.


contains

public static boolean contains(java.lang.String[] strs,
                               java.lang.String str)

getFormattedDate

public static java.lang.String getFormattedDate()
Returns now, as String formatted with DEFAULT_DATEFORMAT.

Returns:
now as formatted String.

Jwma

Copyright © 2000-2003 jwma team (All Rights Reserved.)