java.lang.Object | +--com.ibm.commerce.me.datatype.Utilities
Utility class providing utility method to decode url encoded string to String, file to String, replace values in a String
Field Summary | |
---|---|
static java.lang.String |
COPYRIGHT IBM Copyright field |
Constructor Summary | |
---|---|
Utilities() |
Method Summary | |
---|---|
static java.lang.String |
decodeUrlEncoded(java.lang.String s) Decodes a "x-www-form-urlencoded" to a String. |
static java.lang.String |
fileToString(java.lang.String fileName) Reads file and return the content as a String |
static void |
main(java.lang.String[] args) main entry point of the program. |
static java.lang.String |
replaceString(java.lang.String src, java.lang.String key,
java.lang.String value) Replaces all the occurances of 'key' in the String 'src' with 'value'. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll,
toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String COPYRIGHT
Constructor Detail |
---|
public Utilities()
Method Detail |
---|
public static java.lang.String decodeUrlEncoded(java.lang.String s)
Note: Here we are not bothered about < or >
s
- the String
to decodeString
java.lang.IllegalArgumentException
- Thrown when # is not
followed by numerical Stringpublic static java.lang.String fileToString(java.lang.String fileName) throws java.lang.Exception
fileName
- the file name of the file to be read.java.lang.Exception
- Thrown when the file does not exist or
any related IOExceptionpublic static void main(java.lang.String[] args)
public static java.lang.String replaceString(java.lang.String src, java.lang.String key, java.lang.String value)
src
- the original source string.key
- the string which is to be replaced.value
- the string with which key will be
replaced.