aspose file tools*
The moose likes Applets and the fly likes Getting fresh copy of file on a web server Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » Applets
Bookmark "Getting fresh copy of file on a web server" Watch "Getting fresh copy of file on a web server" New topic
Author

Getting fresh copy of file on a web server

Bob Chad
Greenhorn

Joined: May 20, 2010
Posts: 19
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

Joined: May 20, 2010
Posts: 19
Ok so this is how to do it. We need to use InputSource
import org.xml.sax.InputSource;

 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Getting fresh copy of file on a web server