java – getClass(). getClassLoader(). Getresourceasstream() is caching resources

I have a resource (speed template) that I think can be interchanged in the development process However,

getClass().getClassLoader().getResourceAsStream()

Seems to cache templates Is there a way to disable this feature other than using a file loader instead of a class loader?

Solution

To avoid caching, you can use:

getClass().getClassLoader().getResource().openStream()

I assume to use urlresourceloader instead of classpathresourceloader I just need a file loader

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
***
下一篇>>