Usage of Thread.currentThread().getContextClassLoa

2019-09-30 07:49发布

In my web application, I have kept system.properties file in the web-inf/classes folder.

To Access that file's inputstream, I am using the code snippet below:

InputStream is = Thread.currentThread().getContextClassLoader().getResourceAsStream(SYSTEM_PROPERTIES_FILE)

Is there any other way to access that file?

1条回答
神经病院院长
2楼-- · 2019-09-30 08:35

It simply means: Return the property file as InputStream from the ClassLoader the current thread of my application is running from (in loose english).

查看更多
登录 后发表回答