groovy.lang
Class GroovyCodeSource

java.lang.Object
  extended bygroovy.lang.GroovyCodeSource

public class GroovyCodeSource
extends java.lang.Object

CodeSource wrapper class that allows specific security policies to be associated with a class compiled from groovy source.

Author:
Steve Goetze

Field Summary
(package private)  java.security.cert.Certificate[] certs
          The certificates used to sign the items from the codesource
private  java.security.CodeSource codeSource
          The codeSource to be given the generated class.
private  java.io.InputStream inputStream
          The groovy source to be compiled and turned into a class
private  java.lang.String name
          The name given to the generated class
 
Constructor Summary
  GroovyCodeSource(java.io.File file)
           
(package private) GroovyCodeSource(java.io.InputStream inputStream, java.lang.String name, java.io.File path, java.security.cert.Certificate[] certs)
          Package private constructor called by GroovyClassLoader for signed jar entries
  GroovyCodeSource(java.io.InputStream inputStream, 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.
  GroovyCodeSource(java.lang.String script, java.lang.String name, java.lang.String codeBase)
           
  GroovyCodeSource(java.net.URL url)
           
 
Method Summary
(package private)  java.security.CodeSource getCodeSource()
           
 java.io.InputStream getInputStream()
           
 java.lang.String getName()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

codeSource

private java.security.CodeSource codeSource
The codeSource to be given the generated class. This can be used by policy file grants to administer security.


name

private java.lang.String name
The name given to the generated class


inputStream

private java.io.InputStream inputStream
The groovy source to be compiled and turned into a class


certs

java.security.cert.Certificate[] certs
The certificates used to sign the items from the codesource

Constructor Detail

GroovyCodeSource

public GroovyCodeSource(java.lang.String script,
                        java.lang.String name,
                        java.lang.String codeBase)

GroovyCodeSource

public GroovyCodeSource(java.io.InputStream inputStream,
                        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.


GroovyCodeSource

GroovyCodeSource(java.io.InputStream inputStream,
                 java.lang.String name,
                 java.io.File path,
                 java.security.cert.Certificate[] certs)
Package private constructor called by GroovyClassLoader for signed jar entries


GroovyCodeSource

public GroovyCodeSource(java.io.File file)
                 throws java.io.FileNotFoundException

GroovyCodeSource

public GroovyCodeSource(java.net.URL url)
                 throws java.io.IOException
Method Detail

getCodeSource

java.security.CodeSource getCodeSource()

getInputStream

public java.io.InputStream getInputStream()

getName

public java.lang.String getName()


Copyright © 2003-2005 The Codehaus. All Rights Reserved.