org.opensha.nshmp.util
Class AppConfigurer

java.lang.Object
  extended by org.opensha.nshmp.util.AppConfigurer

Deprecated. Use AppProperties

public class AppConfigurer
extends Object

Description: Class used to configure the application to run on the client's machine. All configuration options are set in a config file called NSHMP_CONFIG in the home directory of the Java installation on the user's machine. This directory is generally write protected and thus one must be an administrator in order to set propertie(s) to be consistent. This prevents the average user from inputting bad settings or otherwise messing up their machine. Also, it is one of few (and the least invasive of those) directories that is known to exist and can be quickly and easily found from within the JRE.

Initially this class only sets and reads proxy settings for users that require such. This can be expanded/subclassed to fully configure the application.

TODO: Allow further customization through the configurations.

Author:
Eric Martinez

Field Summary
static String JAVA_HOME
          Deprecated.  
static String SLASH
          Deprecated.  
 
Constructor Summary
AppConfigurer()
          Deprecated.  
 
Method Summary
static void saveConfig(String key, String value)
          Deprecated. Saves the config property key with the value.
static void saveProxySettings(String proxyHost, String proxyPort)
          Deprecated. Saves the proxyHost and proxyPort configuration values to the proxy_host and proxy_port configuration keys respectively.
static void setProxyConfig(boolean save)
          Deprecated. Attempts to read proxy settings from a config file.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

JAVA_HOME

public static final String JAVA_HOME
Deprecated. 

SLASH

public static final String SLASH
Deprecated. 
Constructor Detail

AppConfigurer

public AppConfigurer()
Deprecated. 
Method Detail

setProxyConfig

public static void setProxyConfig(boolean save)
Deprecated. 
Attempts to read proxy settings from a config file. If the config file does not exist or if an error occures while reading it, then it will prompt the user to input the desired proxy settings.

Parameters:
save - if true, then the configuration settings are saved for future use. If false then not saved.

saveConfig

public static void saveConfig(String key,
                              String value)
Deprecated. 
Saves the config property key with the value. There is no harm in saving random key/value pairs, but this should be avoided. See Class level documentation for a list of valid keys to be used. Appropriate values should be intuitive.

Parameters:
key - The name of the configuration key to be saved
value - The value to assign to the key

saveProxySettings

public static void saveProxySettings(String proxyHost,
                                     String proxyPort)
Deprecated. 
Saves the proxyHost and proxyPort configuration values to the proxy_host and proxy_port configuration keys respectively.

Parameters:
proxyHost - The name of the proxy host to use
proxyPort - A string value representing the port number to use with the corresponding proxyHost