Пример #1
0
 private static Configuration getSugarConfig() throws Exception {
   String sugarConfigStr = System.getProperty("sugar_config");
   if (sugarConfigStr == null) {
     sugarConfigStr = Candybean.CONFIG_DIR.getCanonicalPath() + File.separator + "sugar.config";
   }
   return new Configuration(new File(Utils.adjustPath(sugarConfigStr)));
 }
Пример #2
0
 private static Properties getSugarHooks() throws Exception {
   String sugarHooksStr = System.getProperty("sugar_hooks");
   if (sugarHooksStr == null) {
     sugarHooksStr = Candybean.CONFIG_DIR.getCanonicalPath() + File.separator + "sugar.hooks";
   }
   Properties sugarHooks = new Properties();
   sugarHooks.load(new FileInputStream(new File(Utils.adjustPath(sugarHooksStr))));
   return sugarHooks;
 }
Пример #3
0
 private static Candybean getCandybean() throws Exception {
   String candybeanConfigStr = System.getProperty("candybean_config");
   if (candybeanConfigStr == null) {
     candybeanConfigStr =
         Candybean.CONFIG_DIR.getCanonicalPath() + File.separator + "candybean.config";
   }
   Configuration candybeanConfig =
       new Configuration(new File(Utils.adjustPath(candybeanConfigStr)));
   return Candybean.getInstance(candybeanConfig);
 }