KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > jfun > yan > util > resource > ResourceLoader


1 package jfun.yan.util.resource;
2
3 import java.io.InputStream JavaDoc;
4 import java.io.Serializable JavaDoc;
5 import java.net.URL JavaDoc;
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 JavaDoc{
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 JavaDoc getResource(String JavaDoc 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 JavaDoc getResourceAsStream(String JavaDoc path);
27 }
28
Popular Tags