public final class SecureGroovyScript extends hudson.model.AbstractDescribableImpl<SecureGroovyScript>
DataBoundConstructor parameter;
you must call configuring(org.jenkinsci.plugins.scriptsecurity.scripts.ApprovalContext) or a related method from your own constructor.
Use <f:property field="…"/> to configure it from Jelly.| Modifier and Type | Class and Description |
|---|---|
static class |
SecureGroovyScript.DescriptorImpl |
| Constructor and Description |
|---|
SecureGroovyScript(String script,
boolean sandbox)
Deprecated.
|
SecureGroovyScript(String script,
boolean sandbox,
List<ClasspathEntry> classpath) |
| Modifier and Type | Method and Description |
|---|---|
SecureGroovyScript |
configuring(ApprovalContext context)
To be called in your own
DataBoundConstructor when storing the field of this type. |
SecureGroovyScript |
configuringWithKeyItem()
|
SecureGroovyScript |
configuringWithNonKeyItem()
Convenience form of
configuring(org.jenkinsci.plugins.scriptsecurity.scripts.ApprovalContext) that calls ApprovalContext.withCurrentUser() and ApprovalContext.withItem(hudson.model.Item). |
Object |
evaluate(ClassLoader loader,
groovy.lang.Binding binding)
Runs the Groovy script, using the sandbox if so configured.
|
List<ClasspathEntry> |
getClasspath() |
String |
getScript() |
boolean |
isSandbox() |
@DataBoundConstructor public SecureGroovyScript(String script, boolean sandbox, @CheckForNull List<ClasspathEntry> classpath)
@Deprecated public SecureGroovyScript(String script, boolean sandbox)
public String getScript()
public boolean isSandbox()
@Nonnull public List<ClasspathEntry> getClasspath()
public SecureGroovyScript configuring(ApprovalContext context)
DataBoundConstructor when storing the field of this type.context - an approval contextpublic SecureGroovyScript configuringWithKeyItem()
public SecureGroovyScript configuringWithNonKeyItem()
configuring(org.jenkinsci.plugins.scriptsecurity.scripts.ApprovalContext) that calls ApprovalContext.withCurrentUser() and ApprovalContext.withItem(hudson.model.Item).public Object evaluate(ClassLoader loader, groovy.lang.Binding binding) throws Exception
loader - a class loader for constructing the shell, such as PluginManager.uberClassLoader (will be augmented by getClasspath() if nonempty)binding - Groovy variable bindingsGroovyShell.evaluate(String)Exception - in case of a general problemRejectedAccessException - in case of a sandbox issueUnapprovedUsageException - in case of a non-sandbox issueUnapprovedClasspathException - in case some unapproved classpath entries were requestedCopyright © 2016. All rights reserved.