protected void configureBasicAuth(HttpRequest request) {
        try {
            String username = getConfig().getUsername();
            String password = getConfig().getPassword();
            String up = username + ":" + password; //$NON-NLS-1$
            String base64 = new String(Base64.encodeBase64(up.getBytes("UTF-8"))); //$NON-NLS-1$
            String authHeader = "Basic " + base64; //$NON-NLS-1$
            request.setHeader("Authorization", authHeader); //$NON-NLS-1$
        } catch (UnsupportedEncodingException e) {
            throw new RuntimeException(e);
        }
    }
protected void configureBasicAuth ( HttpRequest request ) { try { String username = getConfig ( ) . getUsername ( ) ; String password = getConfig ( ) . getPassword ( ) ; String up = username + ":" + password ; String base64 = new String ( Base64 . encodeBase64 ( up . getBytes ( "UTF-8" ) ) ) ; String authHeader = "Basic " + base64 ; request . setHeader ( "Authorization" , authHeader ) ; } catch ( UnsupportedEncodingException e ) { throw new RuntimeException ( e ) ; } }
Configures BASIC authentication for the request.
@param request