Java 读取 maven 工程 src 目录下的文件

2021-02-19  

目录结构

project

-src

-config

--config.properties

try (InputStream is = new FileInputStream("./config/config.properties")) {
    //use is
} catch (Exception e) {
    LOG.error("parse .properties file error", e);
}

 

ConstXiong 备案号:苏ICP备16009629号-3