3 import java.net.URLStreamHandler;
4 import java.net.URLStreamHandlerFactory;
5 import java.util.Hashtable;
11 * For handling URL file IO via AJAX in JavaScript version
15 public class AjaxURLStreamHandlerFactory implements URLStreamHandlerFactory {
17 Map<String, AjaxURLStreamHandler> htFactories = new Hashtable<String, AjaxURLStreamHandler>();
19 public AjaxURLStreamHandlerFactory() {
24 public URLStreamHandler createURLStreamHandler(String protocol) {
25 AjaxURLStreamHandler fac = htFactories.get(protocol);
27 htFactories.put(protocol, fac = new AjaxURLStreamHandler(protocol));
28 return (fac.protocol == null ? null : fac);