in src/main/java/org/apache/sling/pipes/PipeBindings.java [162:191]
public void addScript(ResourceResolver resolver, String path) {
if (!allowAdditionalScripts) {
throw new SecurityException("additional scripts are not allowed per configuration");
}
InputStream is = null;
try {
if (path.startsWith("http")) {
try {
URL remoteScript = new URL(path);
is = remoteScript.openStream();
} catch (Exception e) {
log.error("unable to retrieve remote script", e);
}
} else if (path.startsWith("/")) {
Resource scriptResource = resolver.getResource(path);
if (scriptResource != null) {
is = scriptResource.adaptTo(InputStream.class);
}
}
if (is != null) {
try {
getEngine().eval(new InputStreamReader(is), scriptContext);
} catch (Exception e) {
log.error("Add script: unable to evaluate script {}", path, e);
}
}
} finally {
IOUtils.closeQuietly(is);
}
}