2 package net.sourceforge.guacamole.net;
5 * Guacamole - Clientless Remote Desktop
6 * Copyright (C) 2010 Michael Jumper
8 * This program is free software: you can redistribute it and/or modify
9 * it under the terms of the GNU Affero General Public License as published by
10 * the Free Software Foundation, either version 3 of the License, or
11 * (at your option) any later version.
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU Affero General Public License for more details.
18 * You should have received a copy of the GNU Affero General Public License
19 * along with this program. If not, see <http://www.gnu.org/licenses/>.
22 import java.io.IOException;
23 import java.io.InputStream;
24 import java.util.Properties;
25 import net.sourceforge.guacamole.GuacamoleException;
27 public class GuacamoleProperties {
29 private static final Properties properties;
30 private static GuacamoleException exception;
34 properties = new Properties();
38 InputStream stream = GuacamoleProperties.class.getResourceAsStream("/guacamole.properties");
40 throw new IOException("Resource /guacamole.properties not found.");
42 properties.load(stream);
44 catch (IOException e) {
45 exception = new GuacamoleException("Error reading guacamole.properties", e);
50 public static String getProperty(String name) throws GuacamoleException {
51 if (exception != null) throw exception;
52 return properties.getProperty(name);