程序包 com.sh.util
类 ConfigLoader
java.lang.Object
com.sh.util.ConfigLoader
Description: 加载配置文件
Title:首亨软件 - CRM、TSS、ERP等信息化管理软件
-
构造器概要
构造器 -
方法概要
修饰符和类型方法说明static InputStream配置文件,文件不存在会自动创建static InputStream获取配置文件流static PropertiesgetConfigAsProperties(String pathName) 配置文件转化为属性文件static org.jdom2.ElementgetConfigAsXml(String pathName) 配置文件转化为XMLstatic String生成绝对路径static InputStreamgetExConfig(String pathName) 扩展配置文件,文件不存在会自动创建static InputStreamgetExConfig(String pathName, boolean create) 获取外部文件流static PropertiesgetExConfigAsProperties(String pathName) 配置文件转化为属性文件static org.jdom2.ElementgetExConfigAsXml(String pathName) 配置文件转化为XMLstatic String获取外部配置文件路径static InputStreamgetResConfig(String pathName) 类路径配置文件static PropertiesgetResConfigAsProperties(String pathName) 配置文件转化为属性文件static org.jdom2.ElementgetResConfigAsXml(String pathName) 配置文件转化为XML
-
构造器详细资料
-
ConfigLoader
public ConfigLoader()
-
-
方法详细资料
-
getConfigPath
生成绝对路径- 返回:
- String
-
getConfig
配置文件,文件不存在会自动创建- 参数:
pathName- 文件名,如:config.xml或config/config.xml- 返回:
- InputStream
- 抛出:
FileNotFoundException- FileNotFoundException
-
getConfig
获取配置文件流- 参数:
pathName- 文件名,如:config.xml或config/config.xmlcreate- 文件不存在时是否自动创建文件- 返回:
- InputStream
- 抛出:
FileNotFoundException- FileNotFoundException
-
getExConfigPath
获取外部配置文件路径- 返回:
- String
-
getExConfig
扩展配置文件,文件不存在会自动创建- 参数:
pathName- 文件名,如:config.xml或config/config.xml- 返回:
- InputStream
- 抛出:
FileNotFoundException- FileNotFoundException
-
getExConfig
获取外部文件流- 参数:
pathName- 文件名,如:config.xml或config/config.xmlcreate- 文件不存在时是否自动创建文件- 返回:
- InputStream
- 抛出:
FileNotFoundException- FileNotFoundException
-
getResConfig
类路径配置文件- 参数:
pathName- 文件名,如:config.xml或config/config.xml- 返回:
- InputStream
- 抛出:
FileNotFoundException- FileNotFoundException
-
getConfigAsXml
配置文件转化为XML- 参数:
pathName- 文件名,如:config.xml或config/config.xml- 返回:
- Element
- 抛出:
Exception- Exception
-
getExConfigAsXml
配置文件转化为XML- 参数:
pathName- 文件名,如:config.xml或config/config.xml- 返回:
- Element
- 抛出:
Exception- Exception
-
getResConfigAsXml
配置文件转化为XML- 参数:
pathName- 文件名,如:config.xml或config/config.xml- 返回:
- Element
- 抛出:
Exception- Exception
-
getConfigAsProperties
配置文件转化为属性文件- 参数:
pathName- 文件名,如:config.xml或config/config.xml- 返回:
- Properties
- 抛出:
Exception- Exception
-
getExConfigAsProperties
配置文件转化为属性文件- 参数:
pathName- 文件名,如:config.xml或config/config.xml- 返回:
- Properties
- 抛出:
Exception- Exception
-
getResConfigAsProperties
配置文件转化为属性文件- 参数:
pathName- 文件名,如:config.xml或config/config.xml- 返回:
- Properties
- 抛出:
Exception- Exception
-