程序包 com.sh.util

类 ConfigLoader

java.lang.Object
com.sh.util.ConfigLoader

public class ConfigLoader extends Object
Description: 加载配置文件 Title:首亨软件 - CRM、TSS、ERP等信息化管理软件
  • 构造器详细资料

    • ConfigLoader

      public ConfigLoader()
  • 方法详细资料

    • getConfigPath

      public static String getConfigPath()
      生成绝对路径
      返回:
      String
    • getConfig

      public static InputStream getConfig(String pathName) throws FileNotFoundException
      配置文件,文件不存在会自动创建
      参数:
      pathName - 文件名,如:config.xml或config/config.xml
      返回:
      InputStream
      抛出:
      FileNotFoundException - FileNotFoundException
    • getConfig

      public static InputStream getConfig(String pathName, boolean create) throws FileNotFoundException
      获取配置文件流
      参数:
      pathName - 文件名,如:config.xml或config/config.xml
      create - 文件不存在时是否自动创建文件
      返回:
      InputStream
      抛出:
      FileNotFoundException - FileNotFoundException
    • getExConfigPath

      public static String getExConfigPath()
      获取外部配置文件路径
      返回:
      String
    • getExConfig

      public static InputStream getExConfig(String pathName) throws FileNotFoundException
      扩展配置文件,文件不存在会自动创建
      参数:
      pathName - 文件名,如:config.xml或config/config.xml
      返回:
      InputStream
      抛出:
      FileNotFoundException - FileNotFoundException
    • getExConfig

      public static InputStream getExConfig(String pathName, boolean create) throws FileNotFoundException
      获取外部文件流
      参数:
      pathName - 文件名,如:config.xml或config/config.xml
      create - 文件不存在时是否自动创建文件
      返回:
      InputStream
      抛出:
      FileNotFoundException - FileNotFoundException
    • getResConfig

      public static InputStream getResConfig(String pathName) throws FileNotFoundException
      类路径配置文件
      参数:
      pathName - 文件名,如:config.xml或config/config.xml
      返回:
      InputStream
      抛出:
      FileNotFoundException - FileNotFoundException
    • getConfigAsXml

      public static org.jdom2.Element getConfigAsXml(String pathName) throws Exception
      配置文件转化为XML
      参数:
      pathName - 文件名,如:config.xml或config/config.xml
      返回:
      Element
      抛出:
      Exception - Exception
    • getExConfigAsXml

      public static org.jdom2.Element getExConfigAsXml(String pathName) throws Exception
      配置文件转化为XML
      参数:
      pathName - 文件名,如:config.xml或config/config.xml
      返回:
      Element
      抛出:
      Exception - Exception
    • getResConfigAsXml

      public static org.jdom2.Element getResConfigAsXml(String pathName) throws Exception
      配置文件转化为XML
      参数:
      pathName - 文件名,如:config.xml或config/config.xml
      返回:
      Element
      抛出:
      Exception - Exception
    • getConfigAsProperties

      public static Properties getConfigAsProperties(String pathName) throws Exception
      配置文件转化为属性文件
      参数:
      pathName - 文件名,如:config.xml或config/config.xml
      返回:
      Properties
      抛出:
      Exception - Exception
    • getExConfigAsProperties

      public static Properties getExConfigAsProperties(String pathName) throws Exception
      配置文件转化为属性文件
      参数:
      pathName - 文件名,如:config.xml或config/config.xml
      返回:
      Properties
      抛出:
      Exception - Exception
    • getResConfigAsProperties

      public static Properties getResConfigAsProperties(String pathName) throws Exception
      配置文件转化为属性文件
      参数:
      pathName - 文件名,如:config.xml或config/config.xml
      返回:
      Properties
      抛出:
      Exception - Exception