在resources 目录下新建config.properties文件

#文件保存路径

filePath=E:\\images\\file

 

工具类

public class ConfigUtil {
/**
* 获取配置信息
*/
public static Configuration getConfig(){
try {
return new PropertiesConfiguration("config.properties");
} catch (ConfigurationException e) {
throw new RRException("获取配置文件失败,", e);
}
}
}

获取

import org.apache.commons.configuration.Configuration;

public void test(){

  

//配置信息
Configuration config = ConfigUtil.getConfig();
String filepath = config.getString("filePath")+ File.separator ;

 

 

相关文章:

  • 2021-07-16
  • 2022-12-23
  • 2022-02-17
  • 2022-12-23
  • 2021-09-15
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-06-06
  • 2021-09-19
  • 2022-01-28
  • 2022-12-23
  • 2021-10-09
相关资源
相似解决方案