if (user != null && password != null) {
xmlHttpRequest.open(httpMethod, url, user, password);
} else if (user != null) {
xmlHttpRequest.open(httpMethod, url, user);
} else {
xmlHttpRequest.open(httpMethod, url);
}
} catch (JavaScriptException e) {
RequestPermissionException requestPermissionException = new RequestPermissionException(
url);
requestPermissionException.initCause(new RequestException(e.getMessage()));