【发布时间】:2019-03-06 18:34:05
【问题描述】:
我有 Spring Boot 应用程序。我正在尝试读取位于我的资源文件夹中的 json 文件(使用类加载器)。我已经在 azure 上部署了我的应用程序,它给了我错误,没有这样的文件存在,当我打印路径时它给我 null。
【问题讨论】:
-
能否添加加载文件的代码(连同路径)?
-
classLoader = getClass().getClassLoader();文件 file = new File(URLDecoder.decode(classLoader.getResource("tags.ser").getFile()));
标签: java spring azure spring-boot