configuration = reader.read(ip);
}
catch (XmlPullParserException e) {
configuration = null;
throw new ConfigurationException("Nexus configuration file was not loaded, it has the wrong structure.", e);
}
finally {
if (fr != null) {
fr.close();
}
}
// check the model version if loaded
if (configuration != null && !Configuration.MODEL_VERSION.equals(configuration.getVersion())) {
final String message = "Nexus configuration file was loaded but discarded, it has the wrong version number."
+ (" (expected " + Configuration.MODEL_VERSION + ", actual " + configuration.getVersion() + ")");
rejectConfiguration(message, null);
throw new ConfigurationException(message);
}
if (getConfiguration() != null) {
log.info("Configuration loaded successfully.");
}