wt.security
Class RuntimeAccess

java.lang.Object
  extended bywt.security.Access
      extended bywt.security.RuntimeAccess
Direct Known Subclasses:
RuntimeAccess_plugin

public class RuntimeAccess
extends Access

Class that provides wrappers to priviledged runtime methods using the wt.security package. This allows applets to execute applications on the client which is typically restricted by the sandbox.

Supported API: true


Field Summary
private  Runtime runtime
           
 
Fields inherited from class wt.security.Access
 
Constructor Summary
RuntimeAccess()
           
 
Method Summary
 Process exec(String command)
          Wrapper for Runtime.getRuntime().exec() method.
 Process exec(String[] cmdarray, String[] envp)
          Wrapper for Runtime.getRuntime().exec() method.
(package private)  Process exec0(String command)
           
(package private)  Process exec0(String[] cmdarray, String[] envp)
           
static RuntimeAccess getRuntimeAccess()
          Get instance of RuntimeAccess.
static RuntimeAccess getRuntimeAccess(Frame parentFrame)
          Get instance of RuntimeAccess.
 void load(String filename)
          Wrapper for Runtime.getRuntime().load() method.
(package private)  void load0(String filename)
           
 void loadLibrary(String libname)
          Wrapper for Runtime.getRuntime().loadLibrary() method.
(package private)  void loadLibrary0(String libname)
           
 Process run(String file)
          Method to load a file with the associated application.
protected  void setRuntime(Runtime runtime)
           
 
Methods inherited from class wt.security.Access
checkAccess, checkAccessAll, checkClass, checkClass, checkClass, getAccessImpl, setParentFrame
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

runtime

private Runtime runtime
Constructor Detail

RuntimeAccess

public RuntimeAccess()
Method Detail

getRuntimeAccess

public static RuntimeAccess getRuntimeAccess(Frame parentFrame)
Get instance of RuntimeAccess. This instance can then be used to perform file operation that are typically restricted by the sandbox.

Parameters:
parentFrame - the parent frame for security dialog boxes that may be presented

Supported API: true

getRuntimeAccess

public static RuntimeAccess getRuntimeAccess()
Get instance of RuntimeAccess. This instance can then be used to perform file operation that are typically restricted by the sandbox.

Supported API: true


setRuntime

protected void setRuntime(Runtime runtime)

exec

public Process exec(String command)
             throws WTSecurityException,
                    IOException
Wrapper for Runtime.getRuntime().exec() method.

Parameters:
command - the command to be executed

Supported API: true
Throws:
WTSecurityException
IOException

exec0

Process exec0(String command)
        throws WTSecurityException,
               IOException
Throws:
WTSecurityException
IOException

exec

public Process exec(String[] cmdarray,
                    String[] envp)
             throws WTSecurityException,
                    IOException
Wrapper for Runtime.getRuntime().exec() method.

Parameters:
cmdarray - array containing the command to call and its arguments
envp - array containing environment in format name=value

Supported API: true
Throws:
WTSecurityException
IOException

exec0

Process exec0(String[] cmdarray,
              String[] envp)
        throws WTSecurityException,
               IOException
Throws:
WTSecurityException
IOException

run

public Process run(String file)
            throws WTSecurityException,
                   IOException
Method to load a file with the associated application. This method is currently only implemented in Windows by passing the filename to "rundll32.exe url.dll,FileProtocolHandler file://"

Parameters:
file - the file to be loaded by it's associated executable.

Supported API: true
Throws:
WTSecurityException
IOException

load

public void load(String filename)
          throws WTSecurityException
Wrapper for Runtime.getRuntime().load() method.

Parameters:
filename - the file to load

Supported API: true
Throws:
WTSecurityException

load0

void load0(String filename)
     throws WTSecurityException
Throws:
WTSecurityException

loadLibrary

public void loadLibrary(String libname)
                 throws WTSecurityException
Wrapper for Runtime.getRuntime().loadLibrary() method.

Parameters:
libname - the name of the library

Supported API: true
Throws:
WTSecurityException

loadLibrary0

void loadLibrary0(String libname)
            throws WTSecurityException
Throws:
WTSecurityException