Overview | Package | Class | Tree | Deprecated | Index | Help
| ToyIP v. 0.1 API
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## vtk.util
Class VtkUtil

    java.lang.Object
      vtk.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=/path/to/VTKData Medical1

or using environment variable `VTK_DATA_ROOT`

       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.11 $
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.

Overview | Package | Class | Tree | Deprecated | Index | Help
| ToyIP v. 0.1 API
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Jakub Marecek 2008