02/28/2005
 

com.epicentric.common
Class StringUtils

java.lang.Object
  |
  +--com.epicentric.common.StringUtils

Deprecated. as of version 4.5. To be removed in 8.0 or later. Replaced by com.vignette.portal.util.StringUtils.

public class StringUtils
extends Object

Various static utility methods for manipulating strings. This class need not be instantiated.


Method Summary
static String capitalize(String str)
          Deprecated. as of version 4.5. To be removed in 8.0 or later. No replacement.
static String conformToBase64(String input)
          Deprecated. as of version 4.5. To be removed in 8.0 or later. No replacement.
static boolean contains(String string1, String string2)
          Deprecated. as of version 4.5. To be removed in 8.0 or later. Replaced with com.vignette.portal.util.StringUtils.contains(String,String)
static String convertEncoding(String oldValue, String oldCharacterEncoding, String newCharacterEncoding)
          Deprecated. as of version 4.5. To be removed in 8.0 or later. Replaced by com.vignette.portal.util.StringUtils.convertEncoding(String,String,String).
static String convertToDBSafe(String string)
          Deprecated. as of version 4.5. To be removed in 8.0 or later. No replacement.
static Object convertToType(String string, Class type)
          Deprecated. as of version 4.5. To be removed in 8.0 or later. No replacement.
static int countChar(String str, char find)
          Deprecated. as of version 4.5. To be removed in 8.0 or later. No replacement.
static String createRandomString(int str_len)
          Deprecated. as of version 4.5. To be removed in 8.0 or later. Replace with com.vignette.portal.util.DigestUtils.createRandomString(int)
static String decodeBase64(String input)
          Deprecated. as of version 4.5. To be removed in 8.0 or later. Replace with com.vignette.portal.util.Base64Utils.decode(String)
static byte[] decodeBase64ToBytes(String input)
          Deprecated. as of version 4.5. To be removed in 8.0 or later. Replace with com.vignette.portal.util.Base64Utils.decode(String)
static String decodeXMLText(String text)
          Deprecated. as of version 4.5. To be removed in 8.0 or later. Replaced by WebUtils.xmlEntitiesToChars(String).
static String decrypt(String encrypted_string)
          Deprecated. as of version 4.5. To be removed in 8.0 or later. Replace with com.vignette.portal.util.Base64Utils.decode(String)
static String encodeBase64(byte[] input)
          Deprecated. as of version 4.5. To be removed in 8.0 or later. Replace with com.vignette.portal.util.Base64Utils.encode(byte[])
static String encodeBase64(String input)
          Deprecated. as of version 4.5. To be removed in 8.0 or later. Replace with com.vignette.portal.util.Base64Utils.encode(String)
static String encodeXMLText(String text)
          Deprecated. as of version 4.5. To be removed in 8.0 or later. Replaced by WebUtils.charsToXMLEntities(String).
static String encrypt(String clear_string)
          Deprecated. as of version 4.5. To be removed in 8.0 or later. Replace with com.vignette.portal.util.Base64Utils.encode(String)
static boolean equals(String string1, String string2)
          Deprecated. as of version 4.5. To be removed in 8.0 or later. No Replacement.
static boolean equalsOrNull(String string1, String string2)
          Deprecated. as of version 4.5. To be removed in 8.0 or later. No Replacement.
static String escapeQuotes(String nonHTML)
          Deprecated. as of version 4.5. To be removed in 8.0 or later. No replacement.
static int findExactInArray(String targetString, String[] matchSet)
          Deprecated. as of version 4.5. To be removed in 8.0 or later. No replacement.
static int findInArray(String targetString, String[] matchSet, boolean ignoreCase)
          Deprecated. as of version 4.5. To be removed in 8.0 or later. No replacement.
static int findInArrayIgnoreCase(String targetString, String[] matchSet)
          Deprecated. as of version 4.5. To be removed in 8.0 or later. No replacement.
static String[] getArray(Enumeration e)
          Deprecated. as of version 4.5. To be removed in 8.0 or later. No replacement.
static String[] getArray(Hashtable list)
          Deprecated. as of version 4.5. To be removed in 8.0 or later. No replacement.
static String[] getArray(OrderedHashtable list)
          Deprecated. as of version 4.5. To be removed in 8.0 or later. No replacement.
static Object[] getArray(String string)
          Deprecated. as of version 4.5. To be removed in 8.0 or later. No replacement.
static String[] getArray(Vector list)
          Deprecated. as of version 4.5. To be removed in 8.0 or later. No replacement.
static String[] getArrayOfKeys(Hashtable list)
          Deprecated. as of version 4.5. To be removed in 8.0 or later. No replacement.
static String[] getArrayOfKeys(OrderedHashtable list)
          Deprecated. as of version 4.5. To be removed in 8.0 or later. No replacement.
static boolean getBoolean(String string)
          Deprecated. as of version 4.5. To be removed in 8.0 or later. Use Boolean.valueOf(String).booleanValue().
static boolean getBoolean(String string, boolean defaultBoolean)
          Deprecated. as of version 4.5. To be removed in 8.0 or later. Replaced with com.vignette.portal.util.StringUtils.parseBoolean(String, boolean)
static byte getByte(String string)
          Deprecated. as of version 4.5. To be removed in 8.0 or later. Replaced with com.vignette.portal.util.StringUtils.parseByte(String, byte)
static char getChar(String string)
          Deprecated. as of version 4.5. To be removed in 8.0 or later. Use String.charAt(0);.
static double getDouble(String string)
          Deprecated. as of version 4.5. To be removed in 8.0 or later. Replaced with com.vignette.portal.util.StringUtils.parseDouble(String, double)
static float getFloat(String string)
          Deprecated. as of version 4.5. To be removed in 8.0 or later. Replaced with com.vignette.portal.util.StringUtils.parseFloat(String, float)
static int getInt(String string)
          Deprecated. as of version 4.5. To be removed in 8.0 or later. Replaced with com.vignette.portal.util.StringUtils.parseInt(String, int)
static int getInt(String string, int default_value)
          Deprecated. as of version 4.5. To be removed in 8.0 or later. Replaced with com.vignette.portal.util.StringUtils.parseInt(String, int)
static long getLong(String string)
          Deprecated. as of version 4.5. To be removed in 8.0 or later. Replaced with com.vignette.portal.util.StringUtils.parseLong(String, long)
static long getLong(String string, long default_value)
          Deprecated. as of version 4.5. To be removed in 8.0 or later. Replaced with com.vignette.portal.util.StringUtils.parseLong(String, long)
static String getMD5(String input_string)
          Deprecated. as of version 4.5. To be removed in 8.0 or later. Replace with com.vignette.portal.util.DigestUtils.getMD5(String)
static String getSHA1(String input_string)
          Deprecated. as of version 4.5. To be removed in 8.0 or later. Replace with com.vignette.portal.util.DigestUtils.getSHA1(String)
static short getShort(String string)
          Deprecated. as of version 4.5. To be removed in 8.0 or later. Replaced with com.vignette.portal.util.StringUtils.parseShort(String, short)
static String getString(Object string)
          Deprecated. as of version 4.5. To be removed in 8.0 or later. Replaced with com.vignette.portal.util.StringUtils.toString(Object)
static String getString(Object string, String default_value)
          Deprecated. as of version 4.5. To be removed in 8.0 or later. Replaced with com.vignette.portal.util.StringUtils.toString(Object, String, boolean)
static String getString(String initialValue, String defaultValue)
          Deprecated. as of version 4.5. To be removed in 8.0 or later. Replaced with com.vignette.portal.util.StringUtils.toString(String, String, boolean)
static String[] getStringArray(String string)
          Deprecated. as of version 4.5. To be removed in 8.0 or later. No replacement.
static String getTrimString(Object string)
          Deprecated. as of version 4.5. To be removed in 8.0 or later. Replaced with com.vignette.portal.util.StringUtils.trim(Object)
static Class getType(String type)
          Deprecated. as of version 4.5. To be removed in 8.0 or later. No replacement.
static Vector getVector(String string)
          Deprecated. as of version 4.5. To be removed in 8.0 or later. No replacement.
static int indexOf(String src_string, int ch, boolean ignore_case)
          Deprecated. as of version 4.5. To be removed in 8.0 or later. No replacement.
static int indexOf(String src_string, int ch, int fromIndex, boolean ignore_case)
          Deprecated. as of version 4.5. To be removed in 8.0 or later. No replacement.
static int indexOf(String src_string, String str, boolean ignore_case)
          Deprecated. as of version 4.5. To be removed in 8.0 or later. No replacement.
static int indexOf(String src_string, String str, int fromIndex, boolean ignore_case)
          Deprecated. as of version 4.5. To be removed in 8.0 or later. No replacement.
static int indexOfIgnoreCase(String src_string, int ch)
          Deprecated. as of version 4.5. To be removed in 8.0 or later. No replacement.
static int indexOfIgnoreCase(String src_string, int ch, int fromIndex)
          Deprecated. as of version 4.5. To be removed in 8.0 or later. No replacement.
static int indexOfIgnoreCase(String src_string, String str)
          Deprecated. as of version 4.5. To be removed in 8.0 or later. Replace with com.vignette.portal.util.StringUtils.indexOfIgnoreCase(String, String)
static int indexOfIgnoreCase(String src_string, String str, int fromIndex)
          Deprecated. as of version 4.5. To be removed in 8.0 or later. Replace with com.vignette.portal.util.StringUtils.indexOfIgnoreCase(String, String, int)
static boolean isEmpty(Object string)
          Deprecated. as of version 4.5. To be removed in 8.0 or later. No Replacement. This effect can be accomplished using the expression ((obj==null ? "" : obj.toString()).length()==0).
static boolean isEmpty(String string)
          Deprecated. as of version 4.5. To be removed in 8.0 or later. Replaced with com.vignette.portal.util.StringUtils.isEmpty(String)
static boolean isEmptyIgnoreWhitespace(Object string)
          Deprecated. as of version 4.5. To be removed in 8.0 or later. No Replacement. This effect can be accomplished using the expression ((obj==null ? "" : obj.toString()).trim().length()==0).
static boolean isEmptyIgnoreWhitespace(String string)
          Deprecated. as of version 4.5. To be removed in 8.0 or later. Replaced with com.vignette.portal.util.StringUtils.isEmptyIgnoreWhitespace(String)
static boolean isHexidecimalDigit(char digit)
          Deprecated. as of version 4.5. To be removed in 8.0 or later. No replacement.
static boolean isIDChar(char ch)
          Deprecated. as of version 4.5. To be removed in 8.0 or later. No replacement.
static boolean isInteger(String string)
          Deprecated. as of version 4.5. To be removed in 8.0 or later. No replacement.
static boolean isValidEmailAddress(String addr)
          Deprecated. as of version 4.5. To be removed in 8.0 or later. E-mail addresses can be valided through the standard extension javax.mail.internet package.
static boolean isWellFormedIDString(String id)
          Deprecated. as of version 4.5. To be removed in 8.0 or later. No replacement.
static int lastIndexOf(String src_string, int ch, boolean ignore_case)
          Deprecated. as of version 4.5. To be removed in 8.0 or later. No replacement.
static int lastIndexOf(String src_string, int ch, int fromIndex, boolean ignore_case)
          Deprecated. as of version 4.5. To be removed in 8.0 or later. No replacement.
static int lastIndexOf(String src_string, String str, boolean ignore_case)
          Deprecated. as of version 4.5. To be removed in 8.0 or later. No replacement.
static int lastIndexOf(String src_string, String str, int fromIndex, boolean ignore_case)
          Deprecated. as of version 4.5. To be removed in 8.0 or later. No replacement.
static int lastIndexOfIgnoreCase(String src_string, int ch)
          Deprecated. as of version 4.5. To be removed in 8.0 or later. No replacement.
static int lastIndexOfIgnoreCase(String src_string, int ch, int fromIndex)
          Deprecated. as of version 4.5. To be removed in 8.0 or later. No replacement.
static int lastIndexOfIgnoreCase(String src_string, String str)
          Deprecated. as of version 4.5. To be removed in 8.0 or later. No replacement.
static int lastIndexOfIgnoreCase(String src_string, String str, int fromIndex)
          Deprecated. as of version 4.5. To be removed in 8.0 or later. No replacement.
static boolean matchExactInArray(String inString, String[] matchSet)
          Deprecated. as of version 4.5. To be removed in 8.0 or later. No replacement.
static boolean matchInArray(String inString, String[] matchSet, boolean ignoreCase)
          Deprecated. as of version 4.5. To be removed in 8.0 or later. No replacement.
static boolean matchInArrayIgnoreCase(String inString, String[] matchSet)
          Deprecated. as of version 4.5. To be removed in 8.0 or later. No replacement.
static void quicksort(CollationKey[] keys, int l, int u)
          Deprecated. as of version 4.5. To be removed in 8.0 or later. No replacement.
static String remove(String src, String delims)
          Deprecated. as of version 4.5. To be removed in 8.0 or later. No replacement.
static String removeString(String src, String kill)
          Deprecated. as of version 4.5. To be removed in 8.0 or later. No replacement.
static String removeWhitespace(String input)
          Deprecated. as of version 4.5. To be removed in 8.0 or later. Replace with com.vignette.portal.util.StringUtils.removeWhitespace(String)
static String replace(String input, String find, String replace)
          Deprecated. as of version 4.5. To be removed in 8.0 or later. Replace with com.vignette.portal.util.StringUtils.replace(String,String,String)
static String replace(String input, String find, String replace, boolean ignoreCase)
          Deprecated. as of version 4.5. To be removed in 8.0 or later. No replacement.
static String replaceFrom(String input, String find, String replace, int startIndex)
          Deprecated. as of version 4.5. To be removed in 8.0 or later. No replacement.
static String replaceFrom(String input, String find, String replace, int startIndex, boolean ignoreCase)
          Deprecated. as of version 4.5. To be removed in 8.0 or later. No replacement.
static String replaceNext(String input, String find, String replace, int index)
          Deprecated. as of version 4.5. To be removed in 8.0 or later. No replacement.
static String singleLine(String input, int max_length)
          Deprecated. as of version 4.5. To be removed in 8.0 or later. No replacement.
static int skipWhitespace(String string, int index)
          Deprecated. as of version 4.5. To be removed in 8.0 or later. No replacement. Use a.indexOf(a.trim().charAt(0)).
static void sortOnKey(String[] contents)
          Deprecated. as of version 4.5. To be removed in 8.0 or later. No replacement.
static void sortOnKey(Vector string_list)
          Deprecated. as of version 4.5. To be removed in 8.0 or later. No replacement.
static String[] split(String string, String delimiter)
          Deprecated. as of version 4.5. To be removed in 8.0 or later. Replace with com.vignette.portal.util.StringUtils.split(String, String)
static String[] splitOnString(String src, String delim)
          Deprecated. as of version 4.5. To be removed in 8.0 or later. No replacement.
static boolean startsWithXMLHeader(String input)
          Deprecated. as of version 4.5. To be removed in 8.0 or later. No replacement.
static byte[] stringToASCIIBytes(String str)
          Deprecated. as of version 4.5. To be removed in 8.0 or later. No replacement.
static String substring(String source, String beginStr, String endStr)
          Deprecated. as of version 4.5. To be removed in 8.0 or later. No replacement.
static String substringByWord(String src, int start, int end)
          Deprecated. as of version 4.5. To be removed in 8.0 or later. No replacement.
static String tabs(int count)
          Deprecated. as of version 4.5. To be removed in 8.0 or later. Replace with com.vignette.portal.util.StringUtils.repeat(int, char)
static String toHTML(String nonHTML)
          Deprecated. as of version 4.5. To be removed in 8.0 or later. No replacement.
static String toOSPath(String path)
          Deprecated. as of version 4.5. To be removed in 8.0 or later. No replacement.
static String toTitleCase(String str)
          Deprecated. as of version 4.5. To be removed in 8.0 or later. No replacement.
static String truncate(String string, int length, boolean absolute)
          Deprecated. as of version 4.5. To be removed in 8.0 or later. Replaced with {@link com.vignette.portal.util.StringUtils#truncate(String,int,boolean) com.vignette.portal.util.StringUtils.truncate(String,int,boolean).
static String wrapString(String string, int length)
          Deprecated. as of version 4.5. To be removed in 8.0 or later. No replacement.
static String wrapStringAsHtml(String string, int length)
          Deprecated. as of version 4.5. To be removed in 8.0 or later. No replacement.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getString

public static String getString(Object string)
Deprecated. as of version 4.5. To be removed in 8.0 or later. Replaced with com.vignette.portal.util.StringUtils.toString(Object)


getString

public static String getString(Object string,
                               String default_value)
Deprecated. as of version 4.5. To be removed in 8.0 or later. Replaced with com.vignette.portal.util.StringUtils.toString(Object, String, boolean)


getString

public static String getString(String initialValue,
                               String defaultValue)
Deprecated. as of version 4.5. To be removed in 8.0 or later. Replaced with com.vignette.portal.util.StringUtils.toString(String, String, boolean)

Returns the given initial value or the default value if the initial value is empty
Parameters:
initialValue - the intended return string
defaultValue - the default return string
Returns:
initialValue if it is non-null and contains at least one non-whitespace character, or defaultValue if initialValue if empty
Since:
4.0
See Also:
StringUtils.isEmptyIgnoreWhitespace(String)

getTrimString

public static String getTrimString(Object string)
Deprecated. as of version 4.5. To be removed in 8.0 or later. Replaced with com.vignette.portal.util.StringUtils.trim(Object)


isEmpty

public static boolean isEmpty(String string)
Deprecated. as of version 4.5. To be removed in 8.0 or later. Replaced with com.vignette.portal.util.StringUtils.isEmpty(String)


isEmpty

public static boolean isEmpty(Object string)
Deprecated. as of version 4.5. To be removed in 8.0 or later. No Replacement. This effect can be accomplished using the expression ((obj==null ? "" : obj.toString()).length()==0).


isEmptyIgnoreWhitespace

public static boolean isEmptyIgnoreWhitespace(String string)
Deprecated. as of version 4.5. To be removed in 8.0 or later. Replaced with com.vignette.portal.util.StringUtils.isEmptyIgnoreWhitespace(String)


isEmptyIgnoreWhitespace

public static boolean isEmptyIgnoreWhitespace(Object string)
Deprecated. as of version 4.5. To be removed in 8.0 or later. No Replacement. This effect can be accomplished using the expression ((obj==null ? "" : obj.toString()).trim().length()==0).


equals

public static boolean equals(String string1,
                             String string2)
Deprecated. as of version 4.5. To be removed in 8.0 or later. No Replacement.


equalsOrNull

public static boolean equalsOrNull(String string1,
                                   String string2)
Deprecated. as of version 4.5. To be removed in 8.0 or later. No Replacement.

Compares two strings and returns true if both of them are null or if they are equal.
Parameters:
string1 - the first string to be compared.
string2 - the second string to be compared.
Returns:
true if both strins are null or equal.

contains

public static boolean contains(String string1,
                               String string2)
Deprecated. as of version 4.5. To be removed in 8.0 or later. Replaced with com.vignette.portal.util.StringUtils.contains(String,String)


skipWhitespace

public static int skipWhitespace(String string,
                                 int index)
Deprecated. as of version 4.5. To be removed in 8.0 or later. No replacement. Use a.indexOf(a.trim().charAt(0)).

Return the index of the first non-whitespace character in given string, or -1 if string has no non-whitespace characters.
Parameters:
string - Source string
index - Index in source string at which to start search.

isInteger

public static boolean isInteger(String string)
Deprecated. as of version 4.5. To be removed in 8.0 or later. No replacement.


getBoolean

public static boolean getBoolean(String string)
Deprecated. as of version 4.5. To be removed in 8.0 or later. Use Boolean.valueOf(String).booleanValue().

Return true if given string equals "true", ignoring case.

getBoolean

public static boolean getBoolean(String string,
                                 boolean defaultBoolean)
Deprecated. as of version 4.5. To be removed in 8.0 or later. Replaced with com.vignette.portal.util.StringUtils.parseBoolean(String, boolean)

Inspect the given string for "true" or "false, ignoring case. If the string is neither true nor false, return the value of the given default boolean.

getByte

public static byte getByte(String string)
Deprecated. as of version 4.5. To be removed in 8.0 or later. Replaced with com.vignette.portal.util.StringUtils.parseByte(String, byte)

Assuming the specified String represents a byte, returns that byte's value. The radix is assumed to be 10.

Returns 0 if the String cannot be parsed as a byte.

getShort

public static short getShort(String string)
Deprecated. as of version 4.5. To be removed in 8.0 or later. Replaced with com.vignette.portal.util.StringUtils.parseShort(String, short)

Assuming the specified String represents a short, returns that short's value.

Returns 0 if the String cannot be parsed as a short.

getChar

public static char getChar(String string)
Deprecated. as of version 4.5. To be removed in 8.0 or later. Use String.charAt(0);.

Returns first char in the string, or ' ' if string is null or empty.

getInt

public static int getInt(String string)
Deprecated. as of version 4.5. To be removed in 8.0 or later. Replaced with com.vignette.portal.util.StringUtils.parseInt(String, int)

Assuming the specified String represents a int, returns that int's value.

Returns 0 if the String cannot be parsed as a int.

getInt

public static int getInt(String string,
                         int default_value)
Deprecated. as of version 4.5. To be removed in 8.0 or later. Replaced with com.vignette.portal.util.StringUtils.parseInt(String, int)

Assuming the specified String represents a int, returns that int's value.

Returns given default_value if the String cannot be parsed as a int.

getLong

public static long getLong(String string)
Deprecated. as of version 4.5. To be removed in 8.0 or later. Replaced with com.vignette.portal.util.StringUtils.parseLong(String, long)

Assuming the specified String represents a long, returns that long's value.

Returns 0 if the String cannot be parsed as a long.

getLong

public static long getLong(String string,
                           long default_value)
Deprecated. as of version 4.5. To be removed in 8.0 or later. Replaced with com.vignette.portal.util.StringUtils.parseLong(String, long)

Assuming the specified String represents a long, returns that long's value.

Returns 0 if the String cannot be parsed as a long.

getFloat

public static float getFloat(String string)
Deprecated. as of version 4.5. To be removed in 8.0 or later. Replaced with com.vignette.portal.util.StringUtils.parseFloat(String, float)

Assuming the specified String represents a float, returns that float's value.

Returns 0 if the String cannot be parsed as a float.

getDouble

public static double getDouble(String string)
Deprecated. as of version 4.5. To be removed in 8.0 or later. Replaced with com.vignette.portal.util.StringUtils.parseDouble(String, double)

Assuming the specified String represents a double, returns that double's value.

Returns 0 if the String cannot be parsed as a double.

getVector

public static Vector getVector(String string)
Deprecated. as of version 4.5. To be removed in 8.0 or later. No replacement.

Splits string into elements delimited by one of these characters: ; , \t \n or \r.

Returns a vector of the elements. Return empty vector if no elements can be found.

getStringArray

public static String[] getStringArray(String string)
Deprecated. as of version 4.5. To be removed in 8.0 or later. No replacement.

Returns a string array based on the procedure described in getVector(String)
See Also:
StringUtils.getVector(String)

getArray

public static Object[] getArray(String string)
Deprecated. as of version 4.5. To be removed in 8.0 or later. No replacement.

Returns an object array based on the procedure described in getVector(String)
See Also:
StringUtils.getVector(String)

countChar

public static int countChar(String str,
                            char find)
Deprecated. as of version 4.5. To be removed in 8.0 or later. No replacement.

Return the number of occurrences of the given char in the given string.

indexOf

public static int indexOf(String src_string,
                          int ch,
                          boolean ignore_case)
Deprecated. as of version 4.5. To be removed in 8.0 or later. No replacement.

Return the index of the first occurrence of the given character in the given string.
Parameters:
ignore_case - True: ignore case.

indexOfIgnoreCase

public static int indexOfIgnoreCase(String src_string,
                                    int ch)
Deprecated. as of version 4.5. To be removed in 8.0 or later. No replacement.

Return the index of the first occurrence of the given character in the given string, ignoring case.

indexOf

public static int indexOf(String src_string,
                          int ch,
                          int fromIndex,
                          boolean ignore_case)
Deprecated. as of version 4.5. To be removed in 8.0 or later. No replacement.

Return the index of the first occurrence of the given character in the given string after the given position.
Parameters:
src_string - String to be searched.
ch - Character to search for.
fromIndex - Starting position from which to search.
ignore_case - True: ignore case.

indexOfIgnoreCase

public static int indexOfIgnoreCase(String src_string,
                                    int ch,
                                    int fromIndex)
Deprecated. as of version 4.5. To be removed in 8.0 or later. No replacement.

Return the index of the first occurrence of the given character in the given string after the given position.
Parameters:
src_string - String to be searched.
ch - Character to search for.
fromIndex - Starting position from which to search.

lastIndexOf

public static int lastIndexOf(String src_string,
                              int ch,
                              boolean ignore_case)
Deprecated. as of version 4.5. To be removed in 8.0 or later. No replacement.


lastIndexOfIgnoreCase

public static int lastIndexOfIgnoreCase(String src_string,
                                        int ch)
Deprecated. as of version 4.5. To be removed in 8.0 or later. No replacement.


lastIndexOf

public static int lastIndexOf(String src_string,
                              int ch,
                              int fromIndex,
                              boolean ignore_case)
Deprecated. as of version 4.5. To be removed in 8.0 or later. No replacement.


lastIndexOfIgnoreCase

public static int lastIndexOfIgnoreCase(String src_string,
                                        int ch,
                                        int fromIndex)
Deprecated. as of version 4.5. To be removed in 8.0 or later. No replacement.


indexOf

public static int indexOf(String src_string,
                          String str,
                          boolean ignore_case)
Deprecated. as of version 4.5. To be removed in 8.0 or later. No replacement.


indexOfIgnoreCase

public static int indexOfIgnoreCase(String src_string,
                                    String str)
Deprecated. as of version 4.5. To be removed in 8.0 or later. Replace with com.vignette.portal.util.StringUtils.indexOfIgnoreCase(String, String)


indexOf

public static int indexOf(String src_string,
                          String str,
                          int fromIndex,
                          boolean ignore_case)
Deprecated. as of version 4.5. To be removed in 8.0 or later. No replacement.


indexOfIgnoreCase

public static int indexOfIgnoreCase(String src_string,
                                    String str,
                                    int fromIndex)
Deprecated. as of version 4.5. To be removed in 8.0 or later. Replace with com.vignette.portal.util.StringUtils.indexOfIgnoreCase(String, String, int)


lastIndexOf

public static int lastIndexOf(String src_string,
                              String str,
                              boolean ignore_case)
Deprecated. as of version 4.5. To be removed in 8.0 or later. No replacement.


lastIndexOfIgnoreCase

public static int lastIndexOfIgnoreCase(String src_string,
                                        String str)
Deprecated. as of version 4.5. To be removed in 8.0 or later. No replacement.


lastIndexOf

public static int lastIndexOf(String src_string,
                              String str,
                              int fromIndex,
                              boolean ignore_case)
Deprecated. as of version 4.5. To be removed in 8.0 or later. No replacement.


lastIndexOfIgnoreCase

public static int lastIndexOfIgnoreCase(String src_string,
                                        String str,
                                        int fromIndex)
Deprecated. as of version 4.5. To be removed in 8.0 or later. No replacement.


getMD5

public static String getMD5(String input_string)
Deprecated. as of version 4.5. To be removed in 8.0 or later. Replace with com.vignette.portal.util.DigestUtils.getMD5(String)

Return the MD5 representation of the given input_string.

getSHA1

public static String getSHA1(String input_string)
Deprecated. as of version 4.5. To be removed in 8.0 or later. Replace with com.vignette.portal.util.DigestUtils.getSHA1(String)

Return the SHA1 representation of the given input_string.

encrypt

public static String encrypt(String clear_string)
Deprecated. as of version 4.5. To be removed in 8.0 or later. Replace with com.vignette.portal.util.Base64Utils.encode(String)

Return an encrypted string such that the original string can be retrieved via decrypt().

The decryptable-ness will only work on this installation of Vignette Portal. Each Vignette Portal installation encrypt()s strings differently.
See Also:
StringUtils.decrypt(String)

decrypt

public static String decrypt(String encrypted_string)
Deprecated. as of version 4.5. To be removed in 8.0 or later. Replace with com.vignette.portal.util.Base64Utils.decode(String)

Given a string encrypted via encrypt(), return the original string.

This will only decrypt strings encrypted by this installation of Vignette Portal. Each Vignette Portal installation encrypt()s strings differently.
See Also:
StringUtils.encrypt(String)

createRandomString

public static String createRandomString(int str_len)
Deprecated. as of version 4.5. To be removed in 8.0 or later. Replace with com.vignette.portal.util.DigestUtils.createRandomString(int)

Return a randomly-generated string of the given length, containing characters among a-z, A-Z, 0-1, _.

split

public static String[] split(String string,
                             String delimiter)
Deprecated. as of version 4.5. To be removed in 8.0 or later. Replace with com.vignette.portal.util.StringUtils.split(String, String)

Splits the given string into an array of substrings at the given set of character delimiters. For instance, split("a/b\c/d\baby/whee", "/\") returns an array with elements "a", "b", "c", "d", "baby", "whee".

splitOnString

public static String[] splitOnString(String src,
                                     String delim)
Deprecated. as of version 4.5. To be removed in 8.0 or later. No replacement.

Parameters:
delim - is a single token on which to split, rather than a set of tokens like split(). if delim is blank, then no splitting happens.
See Also:
StringUtils.split(java.lang.String, java.lang.String)

tabs

public static String tabs(int count)
Deprecated. as of version 4.5. To be removed in 8.0 or later. Replace with com.vignette.portal.util.StringUtils.repeat(int, char)

Returns a string of the given length consisting entirely of tab ('\t') characters.

replace

public static String replace(String input,
                             String find,
                             String replace)
Deprecated. as of version 4.5. To be removed in 8.0 or later. Replace with com.vignette.portal.util.StringUtils.replace(String,String,String)

Replace all occurrences in 'input' of 'find' with 'replace'.

replace

public static String replace(String input,
                             String find,
                             String replace,
                             boolean ignoreCase)
Deprecated. as of version 4.5. To be removed in 8.0 or later. No replacement.


replaceFrom

public static String replaceFrom(String input,
                                 String find,
                                 String replace,
                                 int startIndex)
Deprecated. as of version 4.5. To be removed in 8.0 or later. No replacement.

Replace all occurrences of 'find' that occur after the specified starting index in 'input' with 'replace'.

replaceFrom

public static String replaceFrom(String input,
                                 String find,
                                 String replace,
                                 int startIndex,
                                 boolean ignoreCase)
Deprecated. as of version 4.5. To be removed in 8.0 or later. No replacement.


replaceNext

public static String replaceNext(String input,
                                 String find,
                                 String replace,
                                 int index)
Deprecated. as of version 4.5. To be removed in 8.0 or later. No replacement.

Replace only the next occurrence in 'input' of 'find' with 'replace' starting at the specified 'index'.

removeWhitespace

public static String removeWhitespace(String input)
Deprecated. as of version 4.5. To be removed in 8.0 or later. Replace with com.vignette.portal.util.StringUtils.removeWhitespace(String)

Removes whitespace from a string.

singleLine

public static String singleLine(String input,
                                int max_length)
Deprecated. as of version 4.5. To be removed in 8.0 or later. No replacement.

Truncates input at max_length characters or right before the first \n found. If truncated at max_length characters, "..." is prepended (making it 258 chars).

Returns "" if input is null or max_length is negative.

Does not modify the input string.

convertToDBSafe

public static String convertToDBSafe(String string)
Deprecated. as of version 4.5. To be removed in 8.0 or later. No replacement.

Strips characters that don't satisfy the condition of Character.isLetterOrDigit().

Returns "" if input string is null.

Does not modify the input string.

convertToType

public static Object convertToType(String string,
                                   Class type)
Deprecated. as of version 4.5. To be removed in 8.0 or later. No replacement.

Converts given string to an object of the given class type. If object is not one of the supported types (Boolean, Byte, Character, Short, Integer, Long, Float, Double, or Vector) then the object returned is the original string.

getType

public static Class getType(String type)
Deprecated. as of version 4.5. To be removed in 8.0 or later. No replacement.


quicksort

public static void quicksort(CollationKey[] keys,
                             int l,
                             int u)
Deprecated. as of version 4.5. To be removed in 8.0 or later. No replacement.

quicksort routine taken from Jon Bentley's _Programming Pearls_, column 10. there are faster algos (see the source for java.util.Arrays#sort1), but this is a lot simpler and more understandable.

sortOnKey

public static void sortOnKey(String[] contents)
Deprecated. as of version 4.5. To be removed in 8.0 or later. No replacement.


sortOnKey

public static void sortOnKey(Vector string_list)
Deprecated. as of version 4.5. To be removed in 8.0 or later. No replacement.


getArray

public static String[] getArray(Hashtable list)
Deprecated. as of version 4.5. To be removed in 8.0 or later. No replacement.


getArrayOfKeys

public static String[] getArrayOfKeys(Hashtable list)
Deprecated. as of version 4.5. To be removed in 8.0 or later. No replacement.


getArray

public static String[] getArray(OrderedHashtable list)
Deprecated. as of version 4.5. To be removed in 8.0 or later. No replacement.


getArrayOfKeys

public static String[] getArrayOfKeys(OrderedHashtable list)
Deprecated. as of version 4.5. To be removed in 8.0 or later. No replacement.


getArray

public static String[] getArray(Vector list)
Deprecated. as of version 4.5. To be removed in 8.0 or later. No replacement.


getArray

public static String[] getArray(Enumeration e)
Deprecated. as of version 4.5. To be removed in 8.0 or later. No replacement.


toHTML

public static String toHTML(String nonHTML)
Deprecated. as of version 4.5. To be removed in 8.0 or later. No replacement.

Format raw text into documents in a semi-logical way. Operations done:

escapeQuotes

public static String escapeQuotes(String nonHTML)
Deprecated. as of version 4.5. To be removed in 8.0 or later. No replacement.

Turn " into " .

encodeBase64

public static String encodeBase64(String input)
Deprecated. as of version 4.5. To be removed in 8.0 or later. Replace with com.vignette.portal.util.Base64Utils.encode(String)

Encode String as base64.

encodeBase64

public static String encodeBase64(byte[] input)
Deprecated. as of version 4.5. To be removed in 8.0 or later. Replace with com.vignette.portal.util.Base64Utils.encode(byte[])

Encode byte array as base64.

decodeBase64

public static String decodeBase64(String input)
Deprecated. as of version 4.5. To be removed in 8.0 or later. Replace with com.vignette.portal.util.Base64Utils.decode(String)

Decode base64 string.

decodeBase64ToBytes

public static byte[] decodeBase64ToBytes(String input)
Deprecated. as of version 4.5. To be removed in 8.0 or later. Replace with com.vignette.portal.util.Base64Utils.decode(String)

Decode base64 string to bytes.

conformToBase64

public static String conformToBase64(String input)
Deprecated. as of version 4.5. To be removed in 8.0 or later. No replacement.

Given a string that is base64 encoded, make sure it conforms to expectations of the base64 decoder by removing whitespace and inserting crlf every 76 bytes.

This is useful when an encoded base64 string has been passed as XML. The XML parser may have flattened the crlfs that were originally placed there by the encoder.

matchInArray

public static boolean matchInArray(String inString,
                                   String[] matchSet,
                                   boolean ignoreCase)
Deprecated. as of version 4.5. To be removed in 8.0 or later. No replacement.

Return true if any string in the given array matches the target string.
Parameters:
inString - String to find in matchSet.
matchSet - Array of strings to search.
ignoreCase - True: ignore case when comparing.
Returns:
true if inString found in matchSet

matchInArrayIgnoreCase

public static boolean matchInArrayIgnoreCase(String inString,
                                             String[] matchSet)
Deprecated. as of version 4.5. To be removed in 8.0 or later. No replacement.

Convenience method for matchInArray(String, String[], boolean).
See Also:
StringUtils.matchInArray(String, String[], boolean)

matchExactInArray

public static boolean matchExactInArray(String inString,
                                        String[] matchSet)
Deprecated. as of version 4.5. To be removed in 8.0 or later. No replacement.

Convenience method for matchInArray(String, String[], boolean).
See Also:
StringUtils.matchInArray(String, String[], boolean)

findInArray

public static int findInArray(String targetString,
                              String[] matchSet,
                              boolean ignoreCase)
Deprecated. as of version 4.5. To be removed in 8.0 or later. No replacement.

Match the target string to any of the strings in the matchSet array. Return the index in the array of the string matched, or -1 if the target string doesn't match any of the strings in the array.
Parameters:
targetString - String to find in matchSet.
matchSet - Array of strings to search.
ignoreCase - True: ignore case when comparing.
Returns:
index to targetString in matchSet, or -1 if not found.

findExactInArray

public static int findExactInArray(String targetString,
                                   String[] matchSet)
Deprecated. as of version 4.5. To be removed in 8.0 or later. No replacement.

Convenience method for findInArray(String, String[], boolean). Finds exact match.
See Also:
StringUtils.findInArray(String, String[], boolean)

findInArrayIgnoreCase

public static int findInArrayIgnoreCase(String targetString,
                                        String[] matchSet)
Deprecated. as of version 4.5. To be removed in 8.0 or later. No replacement.

Convenience method for findInArray(String, String[], boolean). Finds match ignoring case.
See Also:
StringUtils.findInArray(String, String[], boolean)

toOSPath

public static String toOSPath(String path)
Deprecated. as of version 4.5. To be removed in 8.0 or later. No replacement.

Replaces in the given file path string all instances of '/' with the correct path separator (could be '\').

capitalize

public static String capitalize(String str)
Deprecated. as of version 4.5. To be removed in 8.0 or later. No replacement.


substringByWord

public static String substringByWord(String src,
                                     int start,
                                     int end)
Deprecated. as of version 4.5. To be removed in 8.0 or later. No replacement.

Like java.lang.String.substring() except the indices refer to whitespace-separated words, rather than characters.

If the number of words in the string is less than the end index, the entire string is returned.

substring

public static String substring(String source,
                               String beginStr,
                               String endStr)
Deprecated. as of version 4.5. To be removed in 8.0 or later. No replacement.

Returns the substring between the two given string boundaries
Parameters:
source - the string to parse a substring from
beginStr - the starting string boundary
endStr - the ending string boundary
Returns:
a substring from source such that the following is true:

source = "..." + beginStr + source + endStr + "..."

where "..." is an arbitrary string of zero or more characters


remove

public static String remove(String src,
                            String delims)
Deprecated. as of version 4.5. To be removed in 8.0 or later. No replacement.

Parameters:
delims - is a list of individual tokens to remove, not a single string to remove.

removeString

public static String removeString(String src,
                                  String kill)
Deprecated. as of version 4.5. To be removed in 8.0 or later. No replacement.

Parameters:
kill - is a single String, not a set of delimiters, to remove from all occurrances in param src.

stringToASCIIBytes

public static byte[] stringToASCIIBytes(String str)
Deprecated. as of version 4.5. To be removed in 8.0 or later. No replacement.

Method to convert from a string yo a byte array using the ASCII Converter. If ASCII is unavailable or conversion fails, the platform's default is used.

encodeXMLText

public static String encodeXMLText(String text)
Deprecated. as of version 4.5. To be removed in 8.0 or later. Replaced by WebUtils.charsToXMLEntities(String).

Converts special XML/HTML characters to &___; encoded.
 & --> &
 < --> <
 > --> >
 " --> "
 ' --> '
 

decodeXMLText

public static String decodeXMLText(String text)
Deprecated. as of version 4.5. To be removed in 8.0 or later. Replaced by WebUtils.xmlEntitiesToChars(String).

Converts &___; encoded characters back to special HTML/XML chars. The XML Parser automagically decodes &, ', and ", so this only decodes > and <. Also converts null to empty-string
 <   --> <
 >   --> >
 

isWellFormedIDString

public static boolean isWellFormedIDString(String id)
Deprecated. as of version 4.5. To be removed in 8.0 or later. No replacement.

Returns true if the given string has at least one character, and contains only characters within the range [0-9a-zA-Z_]. Strings of this format are used in various places as IDs in the system, and are filename-safe.

isIDChar

public static boolean isIDChar(char ch)
Deprecated. as of version 4.5. To be removed in 8.0 or later. No replacement.

Returns true if character is in the range [0-9a-zA-Z_].

isHexidecimalDigit

public static boolean isHexidecimalDigit(char digit)
Deprecated. as of version 4.5. To be removed in 8.0 or later. No replacement.

Returns true if the character is in the range 0-9A-Fa-f, false otherwise

convertEncoding

public static String convertEncoding(String oldValue,
                                     String oldCharacterEncoding,
                                     String newCharacterEncoding)
                              throws UnsupportedEncodingException
Deprecated. as of version 4.5. To be removed in 8.0 or later. Replaced by com.vignette.portal.util.StringUtils.convertEncoding(String,String,String).

Converts a string produced from bytes in one encoding into the string that would have been constructed if the new encoding was used.
Parameters:
oldValue - The original string value
oldCharacterEncoding - The original string encoding
newCharacterEncoding - The replacement string encoding
Returns:
The converted string
See Also:
String.getBytes(java.lang.String), String.String(byte[], java.lang.String)

startsWithXMLHeader

public static boolean startsWithXMLHeader(String input)
Deprecated. as of version 4.5. To be removed in 8.0 or later. No replacement.

Returns true if string starts with
Parameters:
input - String to be tested.
Returns:
true - if it starts with

isValidEmailAddress

public static boolean isValidEmailAddress(String addr)
Deprecated. as of version 4.5. To be removed in 8.0 or later. E-mail addresses can be valided through the standard extension javax.mail.internet package.

Performs some simple checks to see if the given string conforms to typical email address specifications

This method requires a valid email address to meet the following rules:

  • has a format local-part "@" domain local-part and domain must be dot-atom
  • dot-atom contains no characters other than atext characters or "." surrounded by atext
  • atext = ALPHA / DIGIT / "!" / "#" / "$" / "%" / "&" / "'" / "*" / "+" / "-" / "/" /
  • "=" / "?" / "^" / "_" / "`" / "{" / "|" / "}" / "~"
Parameters:
addr - the email address to validate
Returns:
true if the given address looks valid as far as this method can determine, false if the address contains obvious formatting errors

wrapString

public static String wrapString(String string,
                                int length)
Deprecated. as of version 4.5. To be removed in 8.0 or later. No replacement.

Word-wraps the input string so that it is composed of one or more 'lines' of text, delimited by newline characters, that are each no longer than length characters
Parameters:
string - the string to break up into multiple lines
length - the max number of characters per line, including whitespace characters
Returns:
the wrapped string such that no more than length characters occur within the string between the beginning of the string and the first newline, between newlines, or between the last newline and the end of the string
Since:
4.0

wrapStringAsHtml

public static String wrapStringAsHtml(String string,
                                      int length)
Deprecated. as of version 4.5. To be removed in 8.0 or later. No replacement.

Word-wraps the input string so that it is composed of one or more 'lines' of text, delimited by HTML break tags, that are each no longer than length characters
Parameters:
string - the string to break up into multiple lines
length - the max number of characters per line, including whitespace characters
Returns:
the wrapped string such that no more than length characters occur within the string between the beginning of the string and the first <br>, between <br>'s, or between the last <br> and the end of the string
Since:
4.0
See Also:
StringUtils.wrapString(String, int)

truncate

public static String truncate(String string,
                              int length,
                              boolean absolute)
Deprecated. as of version 4.5. To be removed in 8.0 or later. Replaced with {@link com.vignette.portal.util.StringUtils#truncate(String,int,boolean) com.vignette.portal.util.StringUtils.truncate(String,int,boolean).

Returns the first length characters (or less, if absolute is false) from the input string
Parameters:
string - the string to get characters from
length - the max number of characters to be returned
absolute - boolean flag; true to return exactly length characters from string or just string if it contains less than length characters, false to return as many whole words (non-whitespace character sequences separated by whitespace) from string as will fit within length characters
Returns:
the truncated string; empty if absolute is true and length is less than 0 or if absolute is false and string doesn't begin with any whole words that are less than length characters in length, never null
Since:
4.0

toTitleCase

public static String toTitleCase(String str)
Deprecated. as of version 4.5. To be removed in 8.0 or later. No replacement.

Returns a string made appropriate for use in titles; the first letter of each word is capitalized.
Parameters:
str - the string to convert to title case
Returns:
the title-appropriate string
Since:
4.0

02/28/2005
 

Copyright and Trademark Notices