drools-eclipse/org.guvnor.eclipse.webdav/src/client/org/eclipse/webdav/internal/authentication/BasicAuthority.java
private String credentials(String username, String password) {
        Assert.isNotNull(username);
        Assert.isNotNull(password);

        String userpass = username + ":" + password; //$NON-NLS-1$
        byte[] data = null;

        try {
            data = userpass.getBytes("UTF8"); //$NON-NLS-1$
        } catch (UnsupportedEncodingException e) {
            data = userpass.getBytes();
        }

        return "Basic " + Base64Encoder.encode(data); //$NON-NLS-1$
    }
private String credentials(String username, String password) {
        Assert.isNotNull(username);
        Assert.isNotNull(password);

        String userpass = username + ":" + password; //$NON-NLS-1$
        byte[] data = null;

        try {
            data = userpass.getBytes("UTF8"); //$NON-NLS-1$
        } catch (UnsupportedEncodingException e) {
            data = userpass.getBytes();
        }

        return "Basic " + Base64Encoder.encode(data); //$NON-NLS-1$
    }
private String credentials ( String username , String password ) { Assert . isNotNull ( username ) ; Assert . isNotNull ( password ) ; String userpass = username + ":" + password ; //$NON-NLS-1$ byte [ ] data = null ; try { data = userpass . getBytes ( "UTF8" ) ; //$NON-NLS-1$ } catch ( UnsupportedEncodingException e ) { data = userpass . getBytes ( ) ; } return "Basic " + Base64Encoder . encode ( data ) ; //$NON-NLS-1$ }
Returns the Basic authorization credentials for the given username and
password. The credentials have the following form:
<code>
credentials             = "Basic" basic-credentials
basic-credentials    = base64-user-pass
base64-user-pass        = &lt;base64 encoding of user-pass, except not
limited to 76 char/line&gt;
user-pass            = userid ":" password
userid                = *&lt;TEXT excluding ":"&gt;
password                = *TEXT
</code>
<P>Userids might be case sensitive.
<P>For example, if the user's name is "Aladdin" and the user's
password is "open sesame", the following credentials are supplied:
<code>
Basic QWxhZGRpbjpvcGVuIHN1c2FtZQ==
</code>
@param username
@param password
@return         the Basic authorization credentials for the given
username and password
Returns the Basic authorization credentials for the given username and password . The credentials have the following form : <code > credentials = Basic basic - credentials basic - credentials = base64 - user - pass base64 - user - pass = &lt ; base64 encoding of user - pass except not limited to 76 char / line&gt ; user - pass = userid : password userid = * &lt ; TEXT excluding : &gt ; password = * TEXT < / code > <P > Userids might be case sensitive . <P > For example if the user s name is Aladdin and the user s password is open sesame the following credentials are supplied : <code > Basic QWxhZGRpbjpvcGVuIHN1c2FtZQ == < / code >