} catch (MalformedURLException e) {
throw new RuntimeException("The OBR repository resolver " + getName()
+ " couldn't be configured: repoXmlURL '" + repoXmlURL + "' is not an URL");
}
ArtifactDownloadReport report;
EventManager eventManager = getEventManager();
try {
if (eventManager != null) {
getRepository().addTransferListener(eventManager);
}
Resource obrResource = new URLResource(url);
CacheResourceOptions options = new CacheResourceOptions();
if (metadataTtl != null) {
options.setTtl(metadataTtl.longValue());
}
if (forceMetadataUpdate != null) {
options.setForce(forceMetadataUpdate.booleanValue());
}
report = getRepositoryCacheManager().downloadRepositoryResource(obrResource, "obr",
"obr", "xml", options, getRepository());
} finally {
if (eventManager != null) {
getRepository().removeTransferListener(eventManager);
}
}
URI baseURI;
try {
baseURI = new URI(repoXmlURL);
} catch (URISyntaxException e) {
throw new RuntimeException("illegal uri");
}
loadRepoFromFile(baseURI, report.getLocalFile(), repoXmlURL);
} else {
throw new RuntimeException("The OBR repository resolver " + getName()
+ " couldn't be configured: repoXmlFile or repoXmlUrl is missing");
}