Am trying to periodically browse a file, stats.htm, from within Java using the OpenURI class.
So far I keep getting one version of the file - the one when first accessed. Repeated calls
to the browse() method in code below gives me the same original version of stats.html
NOT the version with the stats updated.
The code is:
public class OpenURI
static String arg = "G:/swm49/agents/stats.htm";
public void OpenURI()
System.out.println("about to open URL");
public void browse()
java.awt.Desktop desktop = java.awt.Desktop.getDesktop();
if( !desktop.isSupported( java.awt.Desktop.Action.BROWSE ) )
System.err.println( "Desktop doesn't support the browse action (fatal)" );
System.exit( 1 );
java.net.URI uri = new java.net.URI( arg );
desktop.browse( uri );
catch ( Exception e )
System.err.println( e.getMessage() );
There is no other explanation. All Java does is pass a file name to the desktop. The desktop starts the browser and passes it the file name. Only the browser actually reads the file. Java and the desktop can't possibly have anything to do with it.
If you're still holding Java responsible for this, you are going to have come up with a plausible mechanism by which Java could send old contents to a browser when it happens at two removes and the only interface in both cases is a file name.
If you're not, you are just off topic.