in src/main/java/org/apache/sling/jcr/contentloader/internal/BundleContentLoader.java [536:568]
private Node createNode(Node parent, String name, URL resourceUrl, final DefaultContentCreator contentCreator,
PathEntry configuration) throws RepositoryException {
final String resourcePath = resourceUrl.getPath().toLowerCase();
InputStream contentStream = null;
try {
// special treatment for system view imports
if (resourcePath.endsWith(EXT_JCR_XML)) {
contentStream = resourceUrl.openStream();
return importJcrXml(parent, name, contentStream, false);
}
// get the node reader for this resource
final ContentReader nodeReader = getContentReader(resourcePath, configuration);
// cannot find out the type
if (nodeReader == null) {
return null;
}
final String contentReaderExtension = getContentReaderExtension(name);
contentCreator.prepareParsing(parent, toPlainName(name, contentReaderExtension));
nodeReader.parse(resourceUrl, contentCreator);
return contentCreator.getCreatedRootNode();
} catch (RepositoryException re) {
throw re;
} catch (Exception t) {
throw new RepositoryException(t.getMessage(), t);
} finally {
IOUtils.closeQuietly(contentStream);
}
}