1 /**
2 *
3 */
4 package org.kit.furia.misc;
5
6 import java.io.File;
7 import java.io.IOException;
8 import java.io.InputStream;
9 import java.util.Properties;
10
11 import org.apache.log4j.PropertyConfigurator;
12
13 /*
14 OBSearch: a distributed similarity search engine
15 This project is to similarity search what 'bit-torrent' is to downloads.
16 Copyright (C) 2007 Arnoldo Jose Muller Molina
17
18 This program is free software: you can redistribute it and/or modify
19 it under the terms of the GNU General Public License as published by
20 the Free Software Foundation, either version 3 of the License, or
21 (at your option) any later version.
22
23 This program is distributed in the hope that it will be useful,
24 but WITHOUT ANY WARRANTY; without even the implied warranty of
25 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
26 GNU General Public License for more details.
27
28 You should have received a copy of the GNU General Public License
29 along with this program. If not, see <http://www.gnu.org/licenses/>.
30 */
31 /**
32 * Test utilities.
33 * @author Arnoldo Jose Muller Molina
34 * @since 0.7
35 */
36 public class FuriaProperties {
37
38 /**
39 * Properties loaded from the properties file.
40 */
41 private static Properties props = null;
42
43 /**
44 * Return the properties from the test properties file.
45 * @return the properties from the test properties file
46 * @throws IOException If the file cannot be read.
47 */
48 public static Properties getProperties() throws IOException {
49 if (props == null) { // load the properties only once
50 InputStream is = FuriaProperties.class
51 .getResourceAsStream( "/furia.properties");
52 props = new Properties();
53 props.load(is);
54 }
55 return props;
56 }
57
58
59
60 public static String getProperty(String x) throws IOException{
61 return getProperties().getProperty(x);
62 }
63
64 }