- import java.util.Properties;
- ...
- static String profilepath="webapps/ROOT/WEB-INF/server.properties";
- private static Properties props = new Properties();
- static {
- try {
- props.load(new FileInputStream(profilepath));
- } catch (FileNotFoundException e) {
- e.printStackTrace();
- } catch (IOException e) {
- e.printStackTrace();
- }
- }
- public static String getKeyValue(String key) {
- return props.getProperty(key);
- }
- //the directory that is used to store lucene index
- public final String indexDir = getKeyValue("INDEX_ROOT");


