public static String getPath() {
String filePath = null;
InputStream in = null;
try {
Properties properties = new Properties();
in = ReadExcelUtil.class.getClassLoader().getResourceAsStream("util.properties");
properties.load(in);
filePath = properties.getProperty("ExcelFilepath");
} catch (FileNotFoundException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
} finally {
try {
if (in != null) in.close();
} catch (IOException e) {
e.printStackTrace();
}
}
return filePath;
}
java 项目 读取properties配置文件
最新推荐文章于 2022-08-17 11:47:40 发布