View Javadoc

1   package org.glassbox;
2   
3   import org.glassbox.gui.*;
4   
5   import java.util.Properties;
6   import java.io.IOException;
7   
8   /***
9      Tools & global properties for the glassbox.
10     The properties are read from the file <code>glassbox.properties</code> in the top level
11     directory of the classpath.
12   */
13  public class Glassbox {
14      private static Properties _properties;
15  
16      /***
17         This class is never instantiated.
18      */
19      private Glassbox() {
20  	//
21      }
22  
23      static {
24  	try {
25  	    _properties = new Properties();
26  	    _properties.load(Glassbox.class.getResourceAsStream("/glassbox.properties"));
27  	} catch (IOException x) {
28  	    //
29  	}	
30      }
31      
32      public static String getProperty(String key) {
33  	return _properties.getProperty(key);
34      }
35  }