Initial auth provider, using properties instead of XML
[guacamole.git] / web-client / src / net / sourceforge / guacamole / net / GuacamoleProperties.java
1
2 package net.sourceforge.guacamole.net;
3
4 import java.io.IOException;
5 import java.util.Properties;
6 import javax.servlet.ServletException;
7 import net.sourceforge.guacamole.GuacamoleException;
8 import net.sourceforge.guacamole.net.authentication.basic.BasicLogin;
9
10 public class GuacamoleProperties {
11
12     private static final Properties properties = new Properties();
13     private static GuacamoleException exception;
14
15     static {
16
17         try {
18             properties.load(BasicLogin.class.getResourceAsStream("/guacamole.properties"));
19         }
20         catch (IOException e) {
21             exception = new GuacamoleException("Error reading guacamole.properties", e);
22         }
23
24     }
25
26     public static String getProperty(String name) throws GuacamoleException {
27         if (exception != null) throw exception;
28         return properties.getProperty(name);
29     }
30
31 }