java(包括springboot)讀取resources下文件方式

方式1 使用項目內路徑讀取,該路徑只在開發工具中顯示,相似:src/main/resources/resource.properties。只能在開發工具中使用,部署以後沒法讀取。(不通用)java File file = new File(「src/main/resources/resource.properties」);linux @Test public void testReadFile2(
相關文章
相關標籤/搜索