Package edu.sc.seis.TauP
Class PropertyLoader
java.lang.Object
edu.sc.seis.TauP.PropertyLoader
public class PropertyLoader
extends java.lang.Object
convenience class for loading properties.
-
Field Summary
Fields Modifier and Type Field Description 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
Constructors Constructor Description PropertyLoader()
-
Method Summary
Modifier and Type Method Description 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 Details
-
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 Details
-
PropertyLoader
public PropertyLoader()
-
-
Method Details
-
load
public static java.util.Properties load() throws java.io.IOExceptionloads 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.IOExceptionwrites 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.IOExceptionwrites the current system properties out to the file given.- Throws:
java.io.IOException
-
main
public static void main(java.lang.String[] args)
-