Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Getting fresh copy of file on a web server

 
Bob Chad
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,

I have a problem retrieving the lastest copy of a file on a server. It seems to be a cache problem.

I solved the problem when reading .TXT files by using this


urlConn.setUseCaches(false) forces Java to reload the file from the server

I have a problem when reading XML files, Java will load the XML file from the web server ONCE only.
How can I force Java to reload ?

Here's my code


If call this code once in my program, it works,
I delete the XML file from the server,
I call this code again using a refresh button,
it still works (??)

Thanks for your help

 
Bob Chad
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ok so this is how to do it. We need to use InputSource
import org.xml.sax.InputSource;

 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic