1 5 package ve.luz.ica.jackass.util; 6 7 import java.io.InputStream ; 8 import java.util.Properties ; 9 10 import org.apache.commons.logging.Log; 11 import org.apache.commons.logging.LogFactory; 12 13 19 public final class ConfigurationManager 20 { 21 24 public static final String TEMP_PATH_PROPERTY = "temp_path"; 25 26 29 public static final String DEPLOYMENT_PATH_PROPERTY = "deployment_path"; 30 31 private static final Log LOG = LogFactory.getLog(ConfigurationManager.class); 32 33 private static final String ERR_READ_PROPERTIES = "Properties file not found"; 34 private static final String DEFAULT_PROPERTIES_FILE = "jackass.properties"; 35 36 private static Properties configFile; 37 38 static 39 { 40 try 41 { 42 configFile = new Properties (); 43 InputStream in = ClassLoader.getSystemResourceAsStream(DEFAULT_PROPERTIES_FILE); 44 configFile.load(in); 45 } 46 catch (Exception e) 47 { 48 if (LOG.isErrorEnabled()) LOG.error(ERR_READ_PROPERTIES, e); 49 throw new IllegalArgumentException (ERR_READ_PROPERTIES + e.getMessage()); 50 } 51 } 52 53 56 private ConfigurationManager() 57 { 58 } 59 60 64 public static Properties getConfigFile() 65 { 66 return configFile; 67 } 68 69 } 70 | Popular Tags |