Does file exist on the network

I am trying to read a file from the network using URLConnection and input stream. if the file exists my code reads correctly but if the file does not exist and i try to read it throws an exception. I just want to know if there is any way to find out if the file exists on the network or not before I read it.

Thanks

[328 byte] By [Austina] at [2007-11-27 3:39:02]
# 1
Read it and catch the exception. Even if there was a way to see if was there before you try to read it you would be introducing a timing window. What if it was there when you looked but not there when you try to read it?
ejpa at 2007-7-12 8:42:23 > top of Java-index,Core,Core APIs...