- Timestamp:
- 2012-05-30T15:34:25+12:00 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/trunk/greenstone3/src/java/org/greenstone/util/GlobalProperties.java
r25387 r25717 32 32 33 33 static Logger logger = Logger.getLogger(org.greenstone.util.GlobalProperties.class.getName()); 34 private static Properties properties = n ull;34 private static Properties properties = new Properties(); 35 35 private static String properties_filename = "global.properties"; 36 36 private static String gsdl3_home = null; 37 37 private static String gsdl3_web_address = null; 38 private static String full_gsdl3_web_address = null; 39 40 // Note, that if the servlet is reloadable, then it is reloaded each time the file is changed. 41 static 42 { 43 //load in the properties 44 properties = new Properties(); 45 reload(); 46 } 38 private static String full_gsdl3_web_address = null; 47 39 48 40 /** get the value of the property 'key'. returns null if not found */ … … 76 68 } 77 69 78 70 public static String getFullGSDL3WebAddress() 79 71 { 80 72 return full_gsdl3_web_address; 81 73 } 82 74 83 public static void reload()75 public static void loadGlobalProperties(String optionalGS3Home) 84 76 { 85 77 try 86 78 { 87 88 79 InputStream in = Class.forName("org.greenstone.util.GlobalProperties").getClassLoader().getResourceAsStream(properties_filename); 89 80 if (in != null) … … 97 88 logger.error("couldn't load global properties!"); 98 89 } 90 99 91 gsdl3_home = properties.getProperty("gsdl3.home"); 92 if ((gsdl3_home == null || gsdl3_home.length() > 0) && optionalGS3Home != null && optionalGS3Home.length() > 0) 93 { 94 gsdl3_home = optionalGS3Home; 95 } 96 100 97 // make sure the path separators are correct 101 98 File gs3_file = new File(gsdl3_home);
Note:
See TracChangeset
for help on using the changeset viewer.