Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

com.aendvari.common.util
Class ResourceLoader  view ResourceLoader download ResourceLoader.java

java.lang.Object
  extended bycom.aendvari.common.util.ResourceLoader

public abstract class ResourceLoader
extends java.lang.Object

This class provides the ability to load a resource using a class as a reference.

A subclass of ResourceLoader must override the getResourceName() method to specify the name of the resource. The resource is expected to be placed within the same package as the subclass.


Constructor Summary
ResourceLoader()
           
 
Method Summary
 java.io.InputStream getResourceAsStream()
          Returns an java.io.InputStream for the resource associated with this class.
static java.io.InputStream getResourceAsStream(java.lang.Class resourceClass)
          Returns an java.io.InputStream for the resource associated with the specified class.
static java.io.InputStream getResourceAsStream(java.lang.String resourceClassPath)
          Returns an java.io.InputStream for the resource associated with the specified class.
protected abstract  java.lang.String getResourceName()
          This method returns the name of the resource.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ResourceLoader

public ResourceLoader()
Method Detail

getResourceName

protected abstract java.lang.String getResourceName()
This method returns the name of the resource.


getResourceAsStream

public java.io.InputStream getResourceAsStream()
                                        throws java.io.IOException
Returns an java.io.InputStream for the resource associated with this class.


getResourceAsStream

public static java.io.InputStream getResourceAsStream(java.lang.String resourceClassPath)
                                               throws java.io.IOException
Returns an java.io.InputStream for the resource associated with the specified class.


getResourceAsStream

public static java.io.InputStream getResourceAsStream(java.lang.Class resourceClass)
                                               throws java.io.IOException
Returns an java.io.InputStream for the resource associated with the specified class. Get the descriptor input stream from the provided descriptor class.