Skip to Main Content

Java SE (Java Platform, Standard Edition)

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

clearing cache

843807Dec 14 2008 — edited Dec 17 2008
Hi,
I have an applet in which i need to download a text file multiple times (the same file). The problem is that the file gets stored in the cache after the first load and therefore each time I try to download it I get the original file.
The only way that I know of to avoid this is to clear the classloader cache through the console (or to restart java).
Is there any way to either clear the cache programmatically (from what I've read you can't) or to force a load? The code is simply:

new BufferedReader( new InputStreamReader( new URL("http://www.URL.txt").openStream()));

thanks
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jan 14 2009
Added on Dec 14 2008
6 comments
241 views