public class GroovyCodeSource extends Object
Constructor and Description |
---|
GroovyCodeSource(File infile) |
GroovyCodeSource(File infile,
String encoding) |
GroovyCodeSource(Reader reader,
String name,
String codeBase)
Construct a GroovyCodeSource for an inputStream of groovyCode that has an
unknown provenance -- meaning it didn't come from a File or a URL (e.g. a String).
|
GroovyCodeSource(String script,
String name,
String codeBase) |
GroovyCodeSource(URI uri) |
GroovyCodeSource(URL url) |
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object o) |
CodeSource |
getCodeSource() |
File |
getFile() |
String |
getName() |
String |
getScriptText() |
URL |
getURL() |
int |
hashCode() |
boolean |
isCachable() |
void |
setCachable(boolean b) |
public GroovyCodeSource(Reader reader, String name, String codeBase)
The permission groovy.security.GroovyCodeSourcePermission will be used to determine if the given codeBase may be specified. That is, the current Policy set must have a GroovyCodeSourcePermission that implies the codeBase, or an exception will be thrown. This is to prevent callers from hijacking existing codeBase policy entries unless explicitly authorized by the user.
public GroovyCodeSource(File infile, String encoding) throws IOException
IOException
public GroovyCodeSource(File infile) throws IOException
infile
- the file to create a GroovyCodeSource for.IOException
- if an issue arises opening and reading the file.public GroovyCodeSource(URI uri) throws IOException
IOException
public GroovyCodeSource(URL url)
public CodeSource getCodeSource()
public String getScriptText()
public String getName()
public File getFile()
public URL getURL()
public void setCachable(boolean b)
public boolean isCachable()