jfun.yan.util.resource
Interface ResourceLoader

All Superinterfaces:
java.io.Serializable
All Known Implementing Classes:
ClassLoader2ResourceLoader, OrResourceLoader, ServletContextResourceLoader

public interface ResourceLoader
extends java.io.Serializable

This interface abstracts the notion of a resource loader that loads resources identified by a string path.

Author:
Ben Yu Jan 16, 2006 1:57:58 PM

Method Summary
 java.net.URL getResource(java.lang.String path)
          Get the URL that identifies the resource.
 java.io.InputStream getResourceAsStream(java.lang.String path)
          Create a InputStream for a resource.
 

Method Detail

getResource

java.net.URL getResource(java.lang.String path)
Get the URL that identifies the resource.

Parameters:
path - the resource path.
Returns:
the URL. null is returned if the path is not recognized.

getResourceAsStream

java.io.InputStream getResourceAsStream(java.lang.String path)
Create a InputStream for a resource.

Parameters:
path - the resource path.
Returns:
the InputStream object or null if not found.