目 录CONTENT

文章目录

Springboot Jar档启动读档案内文件

BKUN
2021-11-13 / 0 评论 / 0 点赞 / 1,283 阅读 / 343 字
	/**
	 * 	以resource为根目录
	 * 	Example:get file static/tpl/tpl.xslx 
	 * 	filePath = static/tpl/tpl.xslx
	 * @param filePath
	 * @return 
	 * @throws Exception
	 */
	public static InputStream getResourceInputStream(String filePath) throws Exception {
		ClassPathResource classPathResource = new ClassPathResource(filePath);
		InputStream inputStream =classPathResource.getInputStream();
		return inputStream;
	}
0

评论区