// This is Jackrabbit XML format ...
return registerNodeTypes(importFromXml(new InputSource(new FileInputStream(file))), allowUpdate);
}
// Assume this is CND format ...
CndImporter importer = new CndImporter(context());
Problems problems = new SimpleProblems();
importer.importFrom(content, problems, file.getAbsolutePath());
// Check for (and report) any problems ...
if (problems.hasProblems()) {
// There are errors and/or warnings, so report them ...
String summary = messageFrom(problems);
if (problems.hasErrors()) {
String msg = JcrI18n.errorsParsingNodeTypeDefinitions.text(file.getAbsolutePath(), summary);
throw new RepositoryException(msg);
}
// Otherwise, there are warnings, so log them ...
I18n msg = JcrI18n.warningsParsingNodeTypeDefinitions;