To quote the Javadocs of URLConnection to which I had already linked to in the previous post :
1. The connection object is created by invoking the openConnection method on a URL.
2. The setup parameters and general request properties are manipulated.
3. The actual connection to the remote object is made, using the connect method.
4. The remote object becomes available. The header fields and the contents of the remote object can be accessed.
So you need to first connect and then check whether the content is available.
Last edited by stephen84s; Dec 15th, 2008 at 2:58 am.
Reputation Points: 653
Solved Threads: 151
Nearly a Posting Virtuoso
Offline 1,316 posts
since Jul 2007