common/src/main/java/HTTPClient/Codecs.java
/**
     * This method encodes the given string using the base64-encoding
     * specified in RFC-2045 (Section 6.8). It's used for example in the
     * "Basic" authorization scheme.
     *
     * @param  str the string
     * @return the base64-encoded <var>str</var>
     */
This method encodes the given string using the base64-encoding
specified in RFC-2045 (Section 6.8). It's used for example in the
"Basic" authorization scheme.

@param  str the string
@return the base64-encoded str
This method encodes the given string using the base64 - encoding specified in RFC - 2045 ( Section 6 . 8 ) . It ' s used for example in the " Basic " authorization scheme . @param str the string @return the base64 - encoded str
public final static String base64Encode(String str)
    {
	if (str == null)  return  null;
	try
	    { return new String(base64Encode(str.getBytes("8859_1")), "8859_1"); }
	catch (UnsupportedEncodingException uee)
	    { throw new Error(uee.toString()); }
    }
public final static String base64Encode ( String str ) { if ( str == null ) return null ; try { return new String ( base64Encode ( str . getBytes ( "8859_1" ) ) , "8859_1" ) ; } catch ( UnsupportedEncodingException uee ) { throw new Error ( uee . toString ( ) ) ; } }
This method encodes the given string using the base64-encoding
 specified in RFC-2045 (Section 6.8).
This method encodes the given string using the base64 - encoding specified in RFC - 2045 ( Section 6 . 8 ) .