spring boot 獲取系統資源文件

ClassPathResource classPathResource = new ClassPathResource("static/fonts/");spring

classPathResource .getURI().getPath(); //獲取文件路徑ci

ClassPathResource classPathResource = new ClassPathResource("financialTemplate/financial.xlsx");資源

classPathResource.getInputStream(); //獲取文件流get

spring boot下 獲取resources文件夾的資源文件class

相關文章
相關標籤/搜索