stsci.tools
Class StsciProps

java.lang.Object
  |
  +--stsci.tools.StsciProps

public class StsciProps
extends java.lang.Object

Class to load properties from file and then be a singleton for thoose properties. This has some just in case the file is not found - but defaults hsould also be sepcifed in calls to getProperty in the code. The property file may be specified on the command line using -DtoolProps=PATH wher e PATH is the full path to the file including the file name. Other wise the file must be in the directory where an application starts. This is a normal property file with PROPNAME=VAL on each line.


Field Summary
(package private) static java.util.Properties props
           
 
Constructor Summary
StsciProps()
           
 
Method Summary
static java.lang.String getProperty(java.lang.String prop)
          Check we are inited then get the property
static java.lang.String getProperty(java.lang.String prop, java.lang.String def)
          Just forwarding the similar method from properrties - allows the caller to specify a default in case the property is not found.
protected static void init()
          initializer only needs to be called once.
static void setProperty(java.lang.String prop, java.lang.String def)
           
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

props

static java.util.Properties props
Constructor Detail

StsciProps

public StsciProps()
Method Detail

init

protected static void init()
initializer only needs to be called once.

getProperty

public static java.lang.String getProperty(java.lang.String prop)
Check we are inited then get the property

getProperty

public static java.lang.String getProperty(java.lang.String prop,
                                           java.lang.String def)
Just forwarding the similar method from properrties - allows the caller to specify a default in case the property is not found. This is the safer method to use in code.

setProperty

public static void setProperty(java.lang.String prop,
                               java.lang.String def)