com.tonbeller.wcf.utils
Class JDK13Utils

java.lang.Object
  extended bycom.tonbeller.wcf.utils.JDK13Utils

public class JDK13Utils
extends java.lang.Object

use 1.4 functions in a 1.3 compatible way


Method Summary
static java.lang.Throwable getCause(java.lang.Throwable e)
          returns the cause exception or null.
static java.util.Locale getLocale(java.lang.String lang)
          replacement for new Locale(String lang)
static java.lang.String urlEncode(java.lang.String s, java.lang.String enc)
          replacement for URLEncoder.encode(String s, String encoding)
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

urlEncode

public static java.lang.String urlEncode(java.lang.String s,
                                         java.lang.String enc)
                                  throws java.io.UnsupportedEncodingException
replacement for URLEncoder.encode(String s, String encoding)

Throws:
java.io.UnsupportedEncodingException

getLocale

public static java.util.Locale getLocale(java.lang.String lang)
replacement for new Locale(String lang)


getCause

public static java.lang.Throwable getCause(java.lang.Throwable e)
returns the cause exception or null. Postcondition: returnvalue != e. Usage pattern:
   Throwable t = ...
   while (t != null) {
     t.printStackTrace();
     t = JDK13Utils.getCause(t);
   }