Package wt.security
Class RuntimeAccess
java.lang.Object
wt.security.Access
wt.security.RuntimeAccess
public class RuntimeAccess
extends wt.security.Access
Class that provides wrappers to privileged 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
Supported API: true
-
Method Summary
Modifier and TypeMethodDescriptionfinal ProcessWrapper for Runtime.getRuntime().exec() method.final ProcessWrapper for Runtime.getRuntime().exec() method.final ProcessWrapper for Runtime.getRuntime().exec() method.static RuntimeAccessGet instance ofRuntimeAccess.static RuntimeAccessgetRuntimeAccess(Frame parentFrame) Get instance ofRuntimeAccess.final voidWrapper for Runtime.getRuntime().load() method.final voidloadLibrary(String libname) Wrapper for Runtime.getRuntime().loadLibrary() method.final voidTries to use Java 6DesktopAPI to open the file and then if that fails falls back to trying run(String).final ProcessDeprecated.Methods inherited from class wt.security.Access
checkAccessAll, getReason, setReason
-
Method Details
-
getRuntimeAccess
Get instance ofRuntimeAccess. This instance can then be used to perform runtime operation that are typically restricted by the sandbox.
Supported API: true- Parameters:
parentFrame- the parent frame for security dialog boxes that may be presented
-
getRuntimeAccess
Get instance ofRuntimeAccess. This instance can then be used to perform runtime operation that are typically restricted by the sandbox.
Supported API: true -
exec
Wrapper for Runtime.getRuntime().exec() method.
Supported API: true- Parameters:
command- the command to be executed- Throws:
WTSecurityExceptionIOException
-
exec
Wrapper for Runtime.getRuntime().exec() method.
Supported API: true- Parameters:
cmdarray- array containing the command to call and its argumentsenvp- array containing environment in format name=value- Throws:
WTSecurityExceptionIOException
-
exec
public final Process exec(String[] cmdarray, String[] envp, File workDir) throws WTSecurityException, IOException Wrapper for Runtime.getRuntime().exec() method.
Supported API: true- Parameters:
cmdarray- array containing the command to call and its argumentsenvp- array containing environment in format name=valueworkDir- working directory of subprocess- Throws:
WTSecurityExceptionIOException
-
run
Deprecated.Use openOrRun(File) orDesktopAccessopen() or edit() APIs instead as these are cross-platform.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://"
Supported API: true- Parameters:
file- the file to be loaded by it's associated executable- Throws:
WTSecurityExceptionIOException
-
openOrRun
Tries to use Java 6DesktopAPI to open the file and then if that fails falls back to trying run(String).
Supported API: true- Parameters:
file- the file to be loaded by it's associated executable- Throws:
WTSecurityExceptionIOException
-
load
Wrapper for Runtime.getRuntime().load() method.
Supported API: true- Parameters:
filename- the file to load- Throws:
WTSecurityException
-
loadLibrary
Wrapper for Runtime.getRuntime().loadLibrary() method.
Supported API: true- Parameters:
libname- the name of the library- Throws:
WTSecurityException
-
DesktopAccessopen() or edit() APIs instead as these are cross-platform.