OutputStream stream = null;
stream = response.getOutputStream();
Properties properties = new Properties();
// FileInputStream fis = new FileInputStream(new File(configPath));
InputStream inputStream=this.getClass().getClassLoader().getResourceAsStream(configPath);
if(inputStream == null){
ResourcePatternResolver resourcePatternResolver = new PathMatchingResourcePatternResolver();
Resource[] resources = resourcePatternResolver.getResources( configPath);
LOGGER.info("getI18nJS={}", resources[0].getFilename());
inputStream = resources[0].getInputStream();
}
properties.loadFromXML(inputStream);
properties.store(stream, "");
springboot 读取jar内部多语言文件
最新推荐文章于 2024-07-06 14:40:08 发布