home *** CD-ROM | disk | FTP | other *** search
- package netscape.net;
-
- import java.net.URL;
- import java.net.URLConnection;
-
- public class URLStreamHandler extends java.net.URLStreamHandler {
- protected URLConnection openConnection(URL u) {
- return new netscape.net.URLConnection(u);
- }
-
- protected void parseURL(URL u, String spec, int start, int limit) {
- super.parseURL(u, spec, start, limit);
- String protocol = u.getProtocol();
- if (protocol.equals("about") || protocol.equals("mailto") || protocol.equals("news") || protocol.equals("snews") || protocol.equals("javascript") || protocol.equals("livescript") || protocol.equals("mocha")) {
- String file = u.getFile();
- file = file.substring(1, file.length());
- ((java.net.URLStreamHandler)this).setURL(u, protocol, u.getHost(), u.getPort(), file, u.getRef());
- }
-
- }
- }
-