how to clear a cached ZipFile
843798Nov 12 2006 — edited Nov 12 2006When you read a ZIP or JAR archive using the ZipFile or JarFile class, its contents are cached. As a result, if you read the archive once, make some changes to it on disk and then read it again later, you may get the original contents rather than the updated contents. I know you can get around the problem by using ZipInputStream rather than ZipFile to read the archive, but that does not help if you need random access to the ZIP contents, not linear access.
So, is there any way to clear the cache of a ZipFile, to force it to read the archive from disk, short of restarting the JVM?