Link to home
Start Free TrialLog in
Avatar of atti
atti

asked on

URL-problems!

Hi,

I'm trying to write a snippet of code, to determine if a URL-documnet
exists, before I use it with the AppletContext.showDocument-method, and
it looks like this:

private boolean fileExist(URL url)
        {
            try {
                InputStream testStream = url.openStream();
                } catch (IOException ioe) {
                    return false;
                }
            return true;
        }

, but it doesn't seem to work!

NetScape's implementation of Java doesn't seems to catch the IOException
at all!

Is there a better way?
ASKER CERTIFIED SOLUTION
Avatar of mnelson051997
mnelson051997

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of atti
atti

ASKER

Are you running a different version of Netscape?
                                 
Yes, I'm running Netscape 4 and it doesn't work.... :-(