protected Set<ResourceIdentity> addRepositoryContent(ManagedContext context, URL resurl) throws IOException {
IllegalArgumentAssertion.assertNotNull(context, "context");
Set<ResourceIdentity> result = new HashSet<>();
if (resurl != null) {
InputStream input = resurl.openStream();
RepositoryMBean repository = MBeanProxy.get(context.getMBeanServer(), RepositoryMBean.OBJECT_NAME, RepositoryMBean.class);
try {
RepositoryReader reader = new DefaultRepositoryXMLReader(input);
Resource auxres = reader.nextResource();
while (auxres != null) {
ResourceIdentity identity = auxres.getIdentity();
if (repository.getResource(identity.getCanonicalForm()) == null) {
repository.addResource(auxres.adapt(CompositeData.class));
result.add(identity);
}
auxres = reader.nextResource();
}
} finally {