125 * </ul> |
125 * </ul> |
126 * <p>The recommended usage is to use {@link java.net.URI} to identify |
126 * <p>The recommended usage is to use {@link java.net.URI} to identify |
127 * resources, then convert it into a {@link java.net.URL} when it is time to |
127 * resources, then convert it into a {@link java.net.URL} when it is time to |
128 * access the resource. From that URL, you can either get the |
128 * access the resource. From that URL, you can either get the |
129 * {@link java.net.URLConnection} for fine control, or get directly the |
129 * {@link java.net.URLConnection} for fine control, or get directly the |
130 * InputStream.<p> |
130 * InputStream. |
131 * <p>Here is an example:</p> |
131 * <p>Here is an example:</p> |
132 * <p><pre> |
132 * <pre> |
133 * URI uri = new URI("http://java.sun.com/"); |
133 * URI uri = new URI("http://java.sun.com/"); |
134 * URL url = uri.toURL(); |
134 * URL url = uri.toURL(); |
135 * InputStream in = url.openStream(); |
135 * InputStream in = url.openStream(); |
136 * </pre> |
136 * </pre> |
137 * <h2>Protocol Handlers</h2> |
137 * <h2>Protocol Handlers</h2> |
145 * <p>By default the protocol handlers are loaded dynamically from the default |
145 * <p>By default the protocol handlers are loaded dynamically from the default |
146 * location. It is, however, possible to add to the search path by setting |
146 * location. It is, however, possible to add to the search path by setting |
147 * the {@code java.protocol.handler.pkgs} system property. For instance if |
147 * the {@code java.protocol.handler.pkgs} system property. For instance if |
148 * it is set to {@code myapp.protocols}, then the URL code will try, in the |
148 * it is set to {@code myapp.protocols}, then the URL code will try, in the |
149 * case of http, first to load {@code myapp.protocols.http.Handler}, then, |
149 * case of http, first to load {@code myapp.protocols.http.Handler}, then, |
150 * if this fails, {@code http.Handler} from the default location.<p> |
150 * if this fails, {@code http.Handler} from the default location. |
151 * <p>Note that the Handler class <b>has to</b> be a subclass of the abstract |
151 * <p>Note that the Handler class <b>has to</b> be a subclass of the abstract |
152 * class {@link java.net.URLStreamHandler}.</p> |
152 * class {@link java.net.URLStreamHandler}.</p> |
153 * <h2>Additional Specification</h2> |
153 * <h2>Additional Specification</h2> |
154 * <ul> |
154 * <ul> |
155 * <li><a href="doc-files/net-properties.html"> |
155 * <li><a href="doc-files/net-properties.html"> |