1 11 package org.eclipse.help.internal.protocols; 12 import java.io.*; 13 import java.net.*; 14 public class HelpURLStreamHandler extends URLStreamHandler { 15 private static HelpURLStreamHandler instance; 16 19 public HelpURLStreamHandler() { 20 super(); 21 } 22 25 protected URLConnection openConnection(URL url) throws IOException { 26 String protocol = url.getProtocol(); 27 if (protocol.equals("help")) { return new HelpURLConnection(url); 29 } 30 return null; 31 } 32 public static URLStreamHandler getDefault() { 33 if (instance == null) { 34 instance = new HelpURLStreamHandler(); 35 } 36 return instance; 37 } 38 } 39 | Popular Tags |