问题
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:
It simply means: Return the property file as InputStream from the ClassLoader the current thread of my application is running from (in loose english).
来源:https://stackoverflow.com/questions/9111484/usage-of-thread-currentthread-getcontextclassloader-getresourceasstreamsys