Package groovy.lang
Class GroovyCodeSource
- java.lang.Object
- 
- groovy.lang.GroovyCodeSource
 
- 
 public class GroovyCodeSource extends java.lang.ObjectCodeSource wrapper class that allows specific security policies to be associated with a class compiled from groovy source.
- 
- 
Constructor SummaryConstructors Constructor Description GroovyCodeSource(java.io.File infile)GroovyCodeSource(java.io.File infile, java.lang.String encoding)GroovyCodeSource(java.io.Reader reader, java.lang.String name, java.lang.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(java.lang.String script, java.lang.String name, java.lang.String codeBase)GroovyCodeSource(java.net.URI uri)GroovyCodeSource(java.net.URL url)
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(java.lang.Object o)java.security.CodeSourcegetCodeSource()java.io.FilegetFile()java.lang.StringgetName()java.lang.StringgetScriptText()java.net.URLgetURL()inthashCode()booleanisCachable()voidsetCachable(boolean b)
 
- 
- 
- 
Constructor Detail- 
GroovyCodeSourcepublic GroovyCodeSource(java.lang.String script, java.lang.String name, java.lang.String codeBase)
 - 
GroovyCodeSourcepublic GroovyCodeSource(java.io.Reader reader, java.lang.String name, java.lang.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). The supplied codeBase will be used to construct a File URL that should match up with a java Policy entry that determines the grants to be associated with the class that will be built from the InputStream.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. 
 - 
GroovyCodeSourcepublic GroovyCodeSource(java.io.File infile, java.lang.String encoding) throws java.io.IOException- Throws:
- java.io.IOException
 
 - 
GroovyCodeSourcepublic GroovyCodeSource(java.io.File infile) throws java.io.IOException- Parameters:
- infile- the file to create a GroovyCodeSource for.
- Throws:
- java.io.IOException- if an issue arises opening and reading the file.
 
 - 
GroovyCodeSourcepublic GroovyCodeSource(java.net.URI uri) throws java.io.IOException- Throws:
- java.io.IOException
 
 - 
GroovyCodeSourcepublic GroovyCodeSource(java.net.URL url) 
 
- 
 - 
Method Detail- 
getCodeSourcepublic java.security.CodeSource getCodeSource() 
 - 
getScriptTextpublic java.lang.String getScriptText() 
 - 
getNamepublic java.lang.String getName() 
 - 
getFilepublic java.io.File getFile() 
 - 
getURLpublic java.net.URL getURL() 
 - 
setCachablepublic void setCachable(boolean b) 
 - 
isCachablepublic boolean isCachable() 
 - 
equalspublic boolean equals(java.lang.Object o) - Overrides:
- equalsin class- java.lang.Object
 
 - 
hashCodepublic int hashCode() - Overrides:
- hashCodein class- java.lang.Object
 
 
- 
 
-