appRepoURL = f.toURI().toURL();
repositoryAdmin.addRepository(appRepoURL);
f.delete();
} catch (Exception e) {
throw new ResolverException(e);
}
try {
if (obrResolver.resolve()) {
Set<BundleInfo> result = new HashSet<BundleInfo>();
for (Resource resource: obrResolver.getRequiredResources()) {
BundleInfo bundleInfo = toBundleInfo(resource);
result.add(bundleInfo);
}
for (Resource resource: obrResolver.getOptionalResources()) {
BundleInfo bundleInfo = toBundleInfo(resource);
result.add(bundleInfo);
}
return result;
} else {
throw new ResolverException("Could not resolve requirements: " + getUnsatisfiedRequirements(obrResolver));
}
} finally {
if (appRepoURL != null) {
repositoryAdmin.removeRepository(appRepoURL);
}