URI uri = new URI("http","localhost","/temp/XYZ.xsd",null);
URL url = uri.toURL();
URLConnection urlConnection = url.openConnection();
Quote from the sun documentation "The recommended way to manage the encoding and decoding of URLs is to use
URI, and to convert between these two classes using
URI.toURL()." I did see this only on the 1.5 version not on 1.4 version of the doc.