VTK Examples in Java

vtk.util
Class VtkUtil

java.lang.Object
  extended byvtk.util.VtkUtil

public class VtkUtil
extends java.lang.Object

Simple utility class for retrieving values of environment variables. SUN's recommended way of passing environment variables to Java VM is by use of -D option at command prompt, for instance, value of variable VTK_DATA_ROOT can be passed like this:

   java -DVTK_DATA_ROOT=${VTK_DATA_ROOT} Medical1
 
Though recommended it is not always convenient. Methods in this class attempt to retrieve actual values of environment variables without use of -D option. Where environment variables are stored and how to access them differs from platform to platform, so getVtkDataRoot or getEnvironmentVariable may not work on all systems.

Version:
$Revision: 1.7 $
Author:
Jarek Sacha

Method Summary
static java.lang.String getEnvironmentVariable(java.lang.String variableName)
          Retrieves value of an environment variable.
static java.lang.String getVtkDataRoot()
          Convenience method for retrieving environment variable VTK_DATA_ROOT.
static void printProperties()
          Print all system properties.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getEnvironmentVariable

public static java.lang.String getEnvironmentVariable(java.lang.String variableName)
                                               throws java.lang.RuntimeException
Retrieves value of an environment variable. Preference is given to values defined at command prompt using option -D, for instance
   java -DVTK_DATA_ROOT=${HOME}/src/VTKData Medical1
 

Parameters:
variableName - Name of the variable to retrieve.
Returns:
Value of the environment variable.
Throws:
java.lang.RuntimeException - when unable to retrieve value of requested variable

getVtkDataRoot

public static java.lang.String getVtkDataRoot()
                                       throws java.lang.RuntimeException
Convenience method for retrieving environment variable VTK_DATA_ROOT.

Returns:
Value of environment variable VTK_DATA_ROOT.
Throws:
java.lang.RuntimeException - when unable to retrieve value of VTK_DATA_ROOT

printProperties

public static void printProperties()
Print all system properties.


SourceForge.net Logo