return source.getNamespaceRegistry().getPrefix(uri) + ":" + local;
}
}
private void copyNamespaces(NodeBuilder root) throws RepositoryException {
NamespaceRegistry sourceRegistry = source.getNamespaceRegistry();
NodeBuilder system = root.child(JCR_SYSTEM);
NodeBuilder namespaces = system.child("rep:namespaces");
Set<String> defaults = ImmutableSet.of(
NamespaceRegistry.NAMESPACE_EMPTY,
NamespaceRegistry.NAMESPACE_JCR,
NamespaceRegistry.NAMESPACE_MIX,
NamespaceRegistry.NAMESPACE_NT,
NamespaceRegistry.NAMESPACE_XML,
NamespaceConstants.NAMESPACE_SV,
NamespaceConstants.NAMESPACE_REP);
logger.info("Copying registered namespaces");
for (String uri : sourceRegistry.getURIs()) {
if (!defaults.contains(uri)) {
namespaces.setProperty(sourceRegistry.getPrefix(uri), uri);
}
}
}