in src/main/java/org/apache/sling/scripting/sightly/impl/engine/bundled/BundledUnitManagerImpl.java [190:209]
public URL getScript(Bindings bindings, String identifier) {
BundledRenderUnit bundledRenderUnit = getBundledRenderUnit(bindings);
Resource currentResource = BindingsUtils.getResource(bindings);
if (currentResource != null && bundledRenderUnit != null) {
for (TypeProvider provider : bundledRenderUnit.getTypeProviders()) {
for (ResourceType type :
provider.getBundledRenderUnitCapability().getResourceTypes()) {
String scriptBundledPath = getResourceTypeQualifiedPath(identifier, type);
if (scriptBundledPath.startsWith("/")) {
scriptBundledPath = scriptBundledPath.substring(1);
}
URL bundledScriptURL = provider.getBundle().getEntry("javax.script/" + scriptBundledPath);
if (bundledScriptURL != null) {
return bundledScriptURL;
}
}
}
}
return null;
}