use of org.eclipse.winery.repository.xml.XmlRepository in project winery by eclipse.
the class MultiRepository method addNamespacesToRepository.
private void addNamespacesToRepository(IRepository repository, GenericId id) {
if (id instanceof DefinitionsChildId) {
Namespace namespace = ((DefinitionsChildId) id).getNamespace();
String ns = namespace.getDecoded();
IRepository r = determineRepositoryRef(repository);
Set<String> set = repositoryGlobal.get(r);
set.add(ns);
repositoryGlobal.put(r, set);
String pns;
try {
if (this.localRepository.getRepository() instanceof XmlRepository) {
pns = namespace.getEncoded().substring(0, namespace.getEncoded().lastIndexOf(RepositoryUtils.getUrlSeparatorEncoded()));
} else {
pns = namespace.getEncoded();
}
} catch (UnsupportedEncodingException ex) {
LOGGER.error("Error when generating the namespace", ex);
return;
}
Set<Namespace> setPre = repositoryCommonNamespace.get(r);
setPre.add(new Namespace(pns, true));
repositoryCommonNamespace.put(r, setPre);
}
}
Aggregations