org.jivesoftware
Class Spark

java.lang.Object
  extended by org.jivesoftware.Spark

public final class Spark
extends java.lang.Object

In many cases, you will need to know the structure of the Spark installation, such as the directory structures, what type of system Spark is running on, and also the arguments which were passed into Spark on startup. The Spark class provides some simple static calls to retrieve this information.

Version:
1.0, 11/17/2005

Method Summary
static java.lang.String getArgumentValue(java.lang.String argumentName)
          Returns the value associated with a passed in argument.
static java.io.File getBinDirectory()
          Returns the bin directory of the Spark install.
static java.io.File getLogDirectory()
          Returns the log directory.
static java.io.File getResourceDirectory()
          Returns the resource directory of the Spark install.
static java.lang.String getUserConf()
          Keep track of the users configuration directory.
static java.lang.String getUserHome()
          Returns the User specific directory for this Spark instance.
static void installBaseUIProperties()
           
static boolean isCustomBuild()
           
static boolean isLinux()
          Return if we are running on Linux.
static boolean isMac()
          Return if we are running on a mac.
static boolean isWindows()
          Return if we are running on windows.
static void main(java.lang.String[] args)
          Invocation method.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

main

public static void main(java.lang.String[] args)
Invocation method.

Parameters:
args - - Will receive arguments from Java Web Start.

isWindows

public static boolean isWindows()
Return if we are running on windows.

Returns:
true if we are running on windows, false otherwise.

isMac

public static boolean isMac()
Return if we are running on a mac.

Returns:
true if we are running on a mac, false otherwise.

getArgumentValue

public static java.lang.String getArgumentValue(java.lang.String argumentName)
Returns the value associated with a passed in argument. Spark accepts HTTP style attributes to allow for name-value pairing. ex. username=foo&password=pwd. To retrieve the value of username, you would do the following:
 String value = Spark.getArgumentValue("username");
 

Parameters:
argumentName - the name of the argument to retrieve.
Returns:
the value of the argument. If no argument was found, null will be returned.

getBinDirectory

public static java.io.File getBinDirectory()
Returns the bin directory of the Spark install. The bin directory contains the startup scripts needed to start Spark.

Returns:
the bin directory.

getResourceDirectory

public static java.io.File getResourceDirectory()
Returns the resource directory of the Spark install. The resource directory contains all native libraries needed to run os specific operations, such as tray support. You may place other native libraries within this directory if you wish to have them placed into the system.library.path.

Returns:
the resource directory.

getLogDirectory

public static java.io.File getLogDirectory()
Returns the log directory. The log directory contains all debugging and error files for Spark.

Returns:
the log directory.

isLinux

public static boolean isLinux()
Return if we are running on Linux.

Returns:
true if we are running on Linux, false otherwise.

getUserConf

public static java.lang.String getUserConf()
Keep track of the users configuration directory.

Returns:
Directory name depending on Operating System.

getUserHome

public static java.lang.String getUserHome()
Returns the User specific directory for this Spark instance. The user home is where all user specific files are placed to run Spark within a multi-user system.

Returns:
the user home;

isCustomBuild

public static boolean isCustomBuild()

installBaseUIProperties

public static void installBaseUIProperties()