1 package jfun.yan.util.resource; 2 3 import java.io.InputStream; 4 import java.io.Serializable; 5 import java.net.URL; 6 7 /** 8 * This interface abstracts the notion of a resource loader 9 * that loads resources identified by a string path. 10 * <p> 11 * @author Ben Yu 12 * Jan 16, 2006 1:57:58 PM 13 */ 14 public interface ResourceLoader extends Serializable{ 15 /** 16 * Get the URL that identifies the resource. 17 * @param path the resource path. 18 * @return the URL. null is returned if the path is not recognized. 19 */ 20 URL getResource(String path); 21 /** 22 * Create a InputStream for a resource. 23 * @param path the resource path. 24 * @return the InputStream object or null if not found. 25 */ 26 InputStream getResourceAsStream(String path); 27 } 28