Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

com.flexstor.common.util
Class StringUtil  view StringUtil download StringUtil.java

java.lang.Object
  extended bycom.flexstor.common.util.StringUtil

public class StringUtil
extends java.lang.Object

String Utility Class

Version:
1.1

Constructor Summary
StringUtil()
           
 
Method Summary
static java.lang.String[] copyArray(java.lang.String[] saOrg)
          Returns a copy of the string array.
static java.lang.String decodeURLString(java.lang.String sInput)
          Decodes a URL string, by replacing % with the actual character.
static java.lang.String encodeURLString(java.lang.String sInput)
          Encodes a URL string, by replacing invalid characters with %.
static java.lang.String getFileNameFromURL(java.lang.String sURL)
          Gets the file name from an URL string, e.g.
static boolean hasInvalidChars(java.lang.String aString)
          Check if a string contains invalid characters (caret, pipe, carriage return).
static java.lang.String replaceChar(char c)
          In accordance with RFC 2396...
static java.lang.String replacePercent(java.lang.String sCode)
           
static java.lang.String replaceString(java.lang.String sSource, java.lang.String sSubString, java.lang.String sReplacement)
          Replaces all occurences of one string within the source string.
static java.lang.String toProper(java.lang.String s)
          Takes a String and capitalizes its first letter
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StringUtil

public StringUtil()
Method Detail

copyArray

public static java.lang.String[] copyArray(java.lang.String[] saOrg)
Returns a copy of the string array.


hasInvalidChars

public static boolean hasInvalidChars(java.lang.String aString)
Check if a string contains invalid characters (caret, pipe, carriage return).


getFileNameFromURL

public static java.lang.String getFileNameFromURL(java.lang.String sURL)
Gets the file name from an URL string, e.g. getFileNameFromURL("http://www.flexstor.com/images/thumb.gif" would return "thumb.gif"


replaceString

public static java.lang.String replaceString(java.lang.String sSource,
                                             java.lang.String sSubString,
                                             java.lang.String sReplacement)
Replaces all occurences of one string within the source string. Does not modify the souce.


encodeURLString

public static java.lang.String encodeURLString(java.lang.String sInput)
Encodes a URL string, by replacing invalid characters with %. Please note that the slash, backslash, and colon are not being replaced by this function, as this would screw up the URL.


decodeURLString

public static java.lang.String decodeURLString(java.lang.String sInput)
Decodes a URL string, by replacing % with the actual character. Please note that the slash, backslash, and colon are not being replaced by this function, as this would screw up the URL.


replaceChar

public static java.lang.String replaceChar(char c)
In accordance with RFC 2396... 2.2. Reserved Characters Many URI include components consisting of or delimited by, certain special characters. These characters are called "reserved", since their usage within the URI component is limited to their reserved purpose. If the data for a URI component would conflict with the reserved purpose, then the conflicting data must be escaped before forming the URI. reserved = ";" | "/" | "?" | ":" | "@" | "&" | "=" | "+" |"$" | "," Others have also been added as needed. And ":" and "/" were omitted


replacePercent

public static java.lang.String replacePercent(java.lang.String sCode)

toProper

public static java.lang.String toProper(java.lang.String s)
Takes a String and capitalizes its first letter