As far as I can tell, there is no easy way to do this.
In theory, you could provide your own URLStreamHandlerFactory, that sets an appropriate timeout on the underlying Socket, then pass it in to the URL constructor, but this would be a non-trivial solution. HTH, Ian Ian D. Stewart Open Systems Engineer II Enterprise Midrange - Bank One Infrastructure & Operations [EMAIL PROTECTED] (614) 244-2564 "Stefan Trcko" <[EMAIL PROTECTED]> on 10/14/2003 06:02:49 AM Please respond to "Struts Users Mailing List" <[EMAIL PROTECTED]> To: "Struts Users Mailing List" <[EMAIL PROTECTED]> cc: Subject: java.net.URL Hello I'm using java.net.URL to get content from other web site. The problem is when this url address which I want to open (openConnection ()) is very slow. When this happens I want that some kind of time out exception is thrown (and the content of this other web site on my site is not shown). How to check that the url cannot be open in for example 2 seconds (and after this 2 second throw an time out exception) Regards Stefan --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] This transmission may contain information that is privileged, confidential and/or exempt from disclosure under applicable law. If you are not the intended recipient, you are hereby notified that any disclosure, copying, distribution, or use of the information contained herein (including any reliance thereon) is STRICTLY PROHIBITED. If you received this transmission in error, please immediately contact the sender and destroy the material in its entirety, whether in electronic or hard copy format. Thank you. --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]