jfun.yan.util.resource
Class ClassLoader2ResourceLoader
java.lang.Object
jfun.yan.util.resource.ClassLoader2ResourceLoader
- All Implemented Interfaces:
- java.io.Serializable, ResourceLoader
public class ClassLoader2ResourceLoader
- extends java.lang.Object
- implements ResourceLoader
An adapter that adapts ClassLoader to ResourceLoader
by delegating ResourceLoader methods to the corresponding ClassLoader methods.
- Author:
- Ben Yu
Jan 16, 2006 2:27:42 PM
- See Also:
- Serialized Form
| Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
ClassLoader2ResourceLoader
public ClassLoader2ResourceLoader(java.lang.ClassLoader cloader)
getResource
public java.net.URL getResource(java.lang.String path)
- Description copied from interface:
ResourceLoader
- Get the URL that identifies the resource.
- Specified by:
getResource in interface ResourceLoader
- Parameters:
path - the resource path.
- Returns:
- the URL. null is returned if the path is not recognized.
getResourceAsStream
public java.io.InputStream getResourceAsStream(java.lang.String path)
- Description copied from interface:
ResourceLoader
- Create a InputStream for a resource.
- Specified by:
getResourceAsStream in interface ResourceLoader
- Parameters:
path - the resource path.
- Returns:
- the InputStream object or null if not found.
getClassLoader
public java.lang.ClassLoader getClassLoader()
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equals in class java.lang.Object
hashCode
public int hashCode()
- Overrides:
hashCode in class java.lang.Object
toString
public java.lang.String toString()
- Overrides:
toString in class java.lang.Object