简体   繁体   English

如何在Spring中加载conf或resources目录下存在的任何文件

[英]How to load any file present under the conf or resources directory in Spring

I am asking a very naive and newbie question. 我在问一个非常幼稚和新手的问题。

Can anybody please tell me the correct way to load a file present under the src/conf or src/resources directory into my Java class using Spring. 谁能告诉我使用Spring将src / conf或src / resources目录下的文件加载到我的Java类中的正确方法。

The spring way would be using the ResourceLoader . 春天的方式是使用ResourceLoader

@See Spring Reference - Chapter 4.4 The ResourceLoader @See Spring参考-第4.4章ResourceLoader

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM