java – getClass(). getClassLoader(). Getresourceasstream() is caching resources
•
Java
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
二维码