Class Configs

java.lang.Object
io.odysz.common.Configs

public class Configs extends Object
Load path/config.xml, use getCfg(String) to access the configured value (String).
A servlet constext must been registed by LeisureFactory before Messages is inited
  • Field Details

  • Constructor Details

    • Configs

      public Configs()
  • Method Details

    • init

      public static void init(String xmlDir)
      For redirect path of config.xml
      Parameters:
      xmlDir -
    • init

      public static String init(String xmlDir, String cfgxml, String... tid)
      Parameters:
      xmlDir -
      cfgxml - e. g. config.xml
      tid - optional [table-name]
      Returns:
      absolute configure file path
      Since:
      2.0.0
    • load

      protected static String load(HashMap<String,HashMap<String,String>> cfgs, String tid)
      Parameters:
      cfgs -
      tid -
      Returns:
      absolute configure file path
    • load

      public static String load(HashMap<String,HashMap<String,String>> cfgs, String xml, String tid)
      Parameters:
      cfgs -
      xml -
      tid -
      Returns:
      absolute configure file path
    • getCfg

      public static String getCfg(String key)
    • getCfg

      public static String getCfg(String tid, String k)
    • getBoolean

      public static boolean getBoolean(String key)
    • getInt

      public static int getInt(String key, int deflt)
    • hasCfg

      public static boolean hasCfg(String key)
    • hasCfg

      public static boolean hasCfg(String tid, String key)