edu.sc.seis.TauP
Class PropertyLoader

java.lang.Object
  extended by edu.sc.seis.TauP.PropertyLoader

public class PropertyLoader
extends java.lang.Object

convenience class for loading properties.

Version:
1.1.3 Wed Jul 18 15:00:35 GMT 2001
Author:
H. Philip Crotwell

Field Summary
protected static java.lang.String defaultPropFileName
           
protected static java.lang.String jarFileName
           
protected static java.lang.String packageName
           
protected static java.lang.String userPropFileName
           
 
Constructor Summary
PropertyLoader()
           
 
Method Summary
static java.util.Properties load()
          loads the properties from a file.
static void main(java.lang.String[] args)
           
static void save(java.util.Properties props)
          writes the current system properties out to the file given.
static void save(java.util.Properties props, java.lang.String filename)
          writes the current system properties out to the file given.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

jarFileName

protected static java.lang.String jarFileName

defaultPropFileName

protected static java.lang.String defaultPropFileName

packageName

protected static java.lang.String packageName

userPropFileName

protected static java.lang.String userPropFileName
Constructor Detail

PropertyLoader

public PropertyLoader()
Method Detail

load

public static java.util.Properties load()
                                 throws java.io.IOException
loads the properties from a file. First the default properties are loaded from the distribution jar file, then the users properties are loaded, overwriting the default values. This uses ".taup" in the users home directory, followed by ".taup" in the current directory if it can be found. If neither can be found then the default Properties object is returned unmodified. A special case is made for the taup.model.path property. If it is defined in the system properties, then the system version is prepended to the users version. This allows for setting system wide search paths on UNIX via an environment variable, which is transformed into a property by the sh scripts, while still allowing individual users as well as non-UNIX systems to customize the search path.

Throws:
java.io.IOException

save

public static void save(java.util.Properties props)
                 throws java.io.IOException
writes the current system properties out to the file given.

Throws:
java.io.IOException

save

public static void save(java.util.Properties props,
                        java.lang.String filename)
                 throws java.io.IOException
writes the current system properties out to the file given.

Throws:
java.io.IOException

main

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


Copyright © 1999-2006 Seismology at the University of South Carolina. All Rights Reserved.