Exemplo n.º 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)));
 }
Exemplo n.º 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;
 }
Exemplo n.º 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);
 }