Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

com.untrusted.script
Class UntrustedScriptHandler  view UntrustedScriptHandler download UntrustedScriptHandler.java

java.lang.Object
  extended bycom.untrusted.script.UntrustedScriptHandler
All Implemented Interfaces:
org.apache.batik.script.ScriptHandler

public class UntrustedScriptHandler
extends java.lang.Object
implements org.apache.batik.script.ScriptHandler

This class implements the ScriptHandler interface and represents an example of untrusted code. It creates a number of Java Permissions and checks that access is denied. the tests fail if the Permissions are granted. The only thing that the class should be allowed to make is a connection back to the server that served the document containing this script.

Version:
$Id: UntrustedScriptHandler.java,v 1.4 2005/03/27 08:58:29 cam Exp $

Field Summary
protected static java.lang.Object[][] basePermissions
          Table of Permissions which will be tested.
private  java.lang.Object[][] permissions
          Set of Permissions to test.
private  org.w3c.dom.Element[] statusRects
          Reference to the rectangles which show the test status
static java.lang.String svgNS
           
static java.lang.String testedHost
          Host which is used for testing
static java.lang.String testedPath
          Path for the file tested with FilePermission
 
Constructor Summary
UntrustedScriptHandler()
           
 
Method Summary
 void run(org.w3c.dom.Document doc, org.apache.batik.script.Window win)
          Runs this handler.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

svgNS

public static final java.lang.String svgNS
See Also:
Constant Field Values

testedPath

public static final java.lang.String testedPath
Path for the file tested with FilePermission

See Also:
Constant Field Values

testedHost

public static final java.lang.String testedHost
Host which is used for testing

See Also:
Constant Field Values

basePermissions

protected static java.lang.Object[][] basePermissions
Table of Permissions which will be tested.


permissions

private java.lang.Object[][] permissions
Set of Permissions to test. One is added if the Document is loaded from a host


statusRects

private org.w3c.dom.Element[] statusRects
Reference to the rectangles which show the test status

Constructor Detail

UntrustedScriptHandler

public UntrustedScriptHandler()
Method Detail

run

public void run(org.w3c.dom.Document doc,
                org.apache.batik.script.Window win)
Runs this handler. This method is called by the SVG viewer when the scripts are loaded.

Specified by:
run in interface org.apache.batik.script.ScriptHandler