项目打包后resources文件下面的静态图片读取不到了 #105
Unanswered
yujumpjump
asked this question in
Q&A
Replies: 1 comment
-
Java中的Path读取的是文件,resources中的内容打包到jar里面后不再属于系统文件读不到很正常。 |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
涉及的编程语言
Java
涉及的组件库
No response
疑问描述
在开发的时候静态图片是放在resources下面的 通过:
PathResource resource = Resource.of(Paths.get("image.png"));
ResourceImage resourceImage = Image.of(resource);
event.getFriend().sendBlocking(resourceImage);
来发送图片是正常的
但是在部署环境的时候他说找不到文件
Beta Was this translation helpful? Give feedback.
All reactions