if (dictionary != null) {
URL aceHost;
try {
String aceHostString = (String) dictionary.get(KEY_ACE_HOST);
if (aceHostString == null) {
throw new ConfigurationException(KEY_ACE_HOST, "Missing property");
}
aceHost = new URL(aceHostString);
}
catch (MalformedURLException e) {
throw new ConfigurationException(KEY_ACE_HOST, "Is not a valid URL", e);
}
URL obrUrl;
try {
String obrUrlString = (String) dictionary.get(KEY_OBR_URL);
if (obrUrlString == null) {
throw new ConfigurationException(KEY_OBR_URL, "Missing property");
}
obrUrl = new URL(obrUrlString);
}
catch (MalformedURLException e) {
throw new ConfigurationException(KEY_OBR_URL, "Is not a valid URL", e);
}
String useAuthString = (String) dictionary.get(KEY_USE_AUTHENTICATION);
if (useAuthString == null || !("true".equalsIgnoreCase(useAuthString) || "false".equalsIgnoreCase(useAuthString))) {
throw new ConfigurationException(KEY_USE_AUTHENTICATION, "Missing or invalid value!");
}
boolean useAuth = Boolean.parseBoolean(useAuthString);
String userNameString = (String) dictionary.get(KEY_USER_NAME);
if ((userNameString == null) && !useAuth) {
throw new ConfigurationException(KEY_USER_NAME, "Missing value; authentication is disabled!");
}
m_useAuth = useAuth;
m_userName = userNameString;
m_aceHost = aceHost;