如何在Wildfly中获取pdf资源文件

时间:2020-01-11 03:35:25

标签: resources wildfly classpath

我已将资源文件保存在作为共享模块的主jar的resource文件夹下。我正在尝试使用

访问文件

File pdf1File = new File (getClass().getClassLoader().getResource("com/org/pack/Page2_Template.pdf").getFile());

我也尝试过resourceAsStream()

这是错误:

... 3 more
Caused by: java.io.FileNotFoundException: C:\wildfly\content\my-ear.ear\lib\my-jar-6.8.0.0.11-RELEASE-SNAPSHOT.jar\com\org\pack1\Page1_Template.pdf (The system cannot find the path specified)

0 个答案:

没有答案