All Downloads are FREE. Search and download functionalities are using the official Maven repository.

javajs.util.AjaxURLStreamHandlerFactory Maven / Gradle / Ivy

There is a newer version: 14.31.10
Show newest version
package javajs.util;

import java.net.URLStreamHandler;
import java.net.URLStreamHandlerFactory;
import java.util.Hashtable;
import java.util.Map;


/**
 * 
 * For handling URL file IO via AJAX in JavaScript version
 * 
 */

public class AjaxURLStreamHandlerFactory implements URLStreamHandlerFactory {

	Map htFactories = new Hashtable();
	
	@Override
  public URLStreamHandler createURLStreamHandler(String protocol) {
		AjaxURLStreamHandler fac = htFactories.get(protocol);
		if (fac == null)
			htFactories.put(protocol, fac = new AjaxURLStreamHandler(protocol));
		return (fac.protocol == null ? null : fac);
	}

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy