On Tue, 1 Nov 2005 09:05:29 +0000 (UTC), John Mowbray
<jmowbray2003@hotmail.com> wrote, quoted or indirectly quoted someone
who said :
>Can't seem to find how to get the status of a connection under Java 2
>5.0. Under 1.4.2 there were all sorts of static ints to give you this
>info, but 5.0 only has a single protected boolean flag.
What classes are you talking about? I have never known Sun yet to
drop a method or field. They deprecate them.

Signature
Canadian Mind Products, Roedy Green.
http://mindprod.com Java custom programming, consulting and coaching.
On Tue, 1 Nov 2005 09:05:29 +0000 (UTC), John Mowbray
<jmowbray2003@hotmail.com> wrote, quoted or indirectly quoted someone
who said :
>Can't seem to find how to get the status of a connection under Java 2
>5.0. Under 1.4.2 there were all sorts of static ints to give you this
>info, but 5.0 only has a single protected boolean flag. Short of going
>back to 1.4.2, does anyone know how to get the status? e.g. is it a
>404-page not found error?
The object you have is likely a java.net.HttpURLConnection
or HttpsURLConnection or JarURLConnection.
Look at methods in those classes. e.g
.HttpURLConnection.getResponseCode.
You could not possibly store info about a connection in a static
field. That has to go in instance fields, otherwise how would you
know which socket it applied to?
the static ints you are likely thinking of, e.g.
HttpURLConnection.HTTP_NOT_FOUND are constants used to fake enums or
represent numbered error messages.

Signature
Canadian Mind Products, Roedy Green.
http://mindprod.com Java custom programming, consulting and coaching.
John Mowbray - 01 Nov 2005 12:27 GMT
My bad - you're absolutely right, I had been confusing URLConnection
with HttpURLConnection.
> On Tue, 1 Nov 2005 09:05:29 +0000 (UTC), John Mowbray
> <jmowbray2003@hotmail.com> wrote, quoted or indirectly quoted someone
[quoted text clipped - 19 lines]
> HttpURLConnection.HTTP_NOT_FOUND are constants used to fake enums or
> represent numbered error messages.