Repository repository = ServiceLocator.getRequiredService(Repository.class);
Set<ResourceIdentity> result = new HashSet<>();
InputStream input = resurl.openStream();
try {
RepositoryReader reader = new DefaultRepositoryXMLReader(input);
Resource auxres = reader.nextResource();
while (auxres != null) {
ResourceIdentity identity = auxres.getIdentity();
if (repository.getResource(identity) == null) {
repository.addResource(auxres);
result.add(identity);
}
auxres = reader.nextResource();
}
} finally {
IOUtils.safeClose(input);
}
return Collections.unmodifiableSet(result);