10 * Diese Klasse realisert den Zugriff auf die Konfiguration.
13 public class Configuration {
15 private static HashMap confs = new HashMap(); // key: conffilename, confHash
16 private String confFilename;
18 private static String defaultconfFilename;
19 static ResourceBundle conf;
21 protected static void initConfResource(String confName) {
22 conf = ResourceBundle.getBundle(confName);
23 confs.put("confname",confName);
26 protected static Enumeration getResourceKeys() {
27 return conf.getKeys();
32 * Fragt ab, ob das Betriebssystem Windows ist.
33 * @return true wenn ja, sonst false.
35 protected static boolean isWindows() {
36 return System.getProperty("os.name").toLowerCase().indexOf("win") >= 0;
40 * Liefert Wert einer Property zurueck
42 * @return Wert der Property
44 protected static String getProperty(String propName) { // default
45 return conf.getString(propName);
49 * Checks if open posting should be direct or indirect
50 * @return true if open posting should be direct
52 protected static boolean directOp() {
53 String op = conf.getString("DirectOpenposting");
54 if(op.equals("yes") || op.equals("Yes") || op.equals("y") || op.equals("Y")){
61 * Liest eine Property eines Modules aus der Konfiguration
65 * @return Wert der Property
67 protected String getProperty(String filename ,String theModule, String propName) {
68 return getProperty(filename, theModule + "." + propName);
72 * Liest eine Property aus der Konfiguration
75 * @return Wert der Property
77 protected static String getProperty(String filename, String propName) {
78 if (filename != null) {
80 HashMap conf = ((HashMap)confs.get("confname"));
83 System.err.println("Keine Konfiguration fuer " + filename);
85 prop = (String)conf.get(propName);
89 System.err.println("Keine Konfiguration fuer " + filename + " " + propName);
95 System.err.println("--- filename null!");
102 * Liefert Hashtable mit den Konfigurationen
105 public static HashMap getConfs(){