in src/main/java/org/apache/sling/scripting/esx/Module.java [322:340]
private ModuleScript createModuleScript(Resource file, int type) throws ScriptException {
log.debug("module created. " + file.getPath());
Node currentNode = file.adaptTo(Node.class);
if (currentNode != null) {
log.debug("currentNode !) null = " + (currentNode != null));
try {
boolean isFile = currentNode.isNodeType(NodeType.NT_FILE);
log.debug("isFile: " + isFile);
if (isFile) {
return new ModuleScript(type, file);
}
log.debug("not a file " + currentNode.getMixinNodeTypes().toString());
} catch (RepositoryException ex) {
throw new ScriptException("cannot load file " + file.getPath());
}
}
return null;
}