List nodeTypeDefs = new ArrayList();
if (contentType.equalsIgnoreCase(TEXT_XML)
|| contentType.equalsIgnoreCase(APPLICATION_XML)) {
try {
NodeTypeReader ntr = new NodeTypeReader(in);
Properties namespaces = ntr.getNamespaces();
if (namespaces != null) {
Enumeration prefixes = namespaces.propertyNames();
while (prefixes.hasMoreElements()) {
String prefix = (String) prefixes.nextElement();
String uri = namespaces.getProperty(prefix);
namespaceMap.put(prefix, uri);
}
}
NodeTypeDef[] defs = ntr.getNodeTypeDefs();
nodeTypeDefs.addAll(Arrays.asList(defs));
} catch (IllegalNameException e) {
throw new RepositoryException("Illegal JCR name syntax", e);
} catch (UnknownPrefixException e) {
throw new RepositoryException("Unknown namespace prefix", e);