private void generateOBRRepoXML(boolean nullURI, String ... bundleFiles) throws Exception
{
Set<ModelledResource> mrs = new HashSet<ModelledResource>();
FileOutputStream fout = new FileOutputStream("repository.xml");
RepositoryGenerator repositoryGenerator = context().getService(RepositoryGenerator.class);
ModelledResourceManager modelledResourceManager = context().getService(ModelledResourceManager.class);
for (String fileName : bundleFiles) {
File bundleFile = new File(fileName);
IDirectory jarDir = FileSystem.getFSRoot(bundleFile);
String uri = "";
if (!!!nullURI) {
uri = bundleFile.toURI().toString();
}
if ("delete.jar".equals(fileName)) {
jarDir = null;
}
mrs.add(modelledResourceManager.getModelledResource(uri, jarDir));
}
repositoryGenerator.generateRepository("Test repo description", mrs, fout);
fout.close();
}