org.foray.common
Class Environment

java.lang.Object
  extended by org.foray.common.Environment

public final class Environment
extends Object

Class with some convenience methods for getting information about the environment.


Method Summary
static Properties getBuildProperties()
          Provides the build properties.
static File getExamplesDirectory()
          Returns the local directory that contains the test files.
static File getSandbox()
          Returns the directory that is the root of the local sandbox, for example, "D:/u/user/foray/trunk/foray".
static File getTestDirectory()
          Returns the local directory that contains the test files.
static boolean isGraphicalEnvironment()
          Determines whether this environment can support graphical functions that are required for system fonts, Batik (SVG processing), and other AWT-dependent systems.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

isGraphicalEnvironment

public static boolean isGraphicalEnvironment()
Determines whether this environment can support graphical functions that are required for system fonts, Batik (SVG processing), and other AWT-dependent systems. The result returned here is somewhat different from that returned by GraphicsEnvironment.isHeadless(). Some environments that are not headless, i.e. that support a mouse, keyboard, and display, are nevertheless not graphical. A Unix/Linux terminal is a good example.

Returns:
True iff a local graphical environment can be created.

getBuildProperties

public static Properties getBuildProperties()
                                     throws IOException
Provides the build properties. This method should only be used by parts of the application used by developers, such as testing and building routines. It is assumed that these developers will have the appropriate environment information set for this method to work properly.

Returns:
The build properties.
Throws:
IOException - If, for any reason, the build properties file is not found or cannot be parsed into a Properties instance.

getSandbox

public static File getSandbox()
                       throws IOException
Returns the directory that is the root of the local sandbox, for example, "D:/u/user/foray/trunk/foray".

Returns:
The directory that is the root of the local sandbox.
Throws:
IOException - For errors obtaining the build properties.

getTestDirectory

public static File getTestDirectory()
                             throws IOException
Returns the local directory that contains the test files.

Returns:
The local directory that contains the test files.
Throws:
IOException - For errors obtaining the build properties.

getExamplesDirectory

public static File getExamplesDirectory()
                                 throws IOException
Returns the local directory that contains the test files.

Returns:
The local directory that contains the test files.
Throws:
IOException - For errors obtaining the build properties.


Copyright © 2017. All rights reserved.