org.spicefactory.lib.resource
Class ClassPathResource

java.lang.Object
  extended by org.spicefactory.lib.resource.AbstractResource
      extended by org.spicefactory.lib.resource.ClassPathResource
All Implemented Interfaces:
Resource

public class ClassPathResource
extends AbstractResource

Resource implementation for class path resources.

Author:
Jens Halm

Constructor Summary
ClassPathResource(String path)
          Creates a new ClassPathResource for the given path using the thread context ClassLoader.
ClassPathResource(String path, Class<?> c)
          Creates a new ClassPathResource for the given path using the specified Class to load the resource.
ClassPathResource(String path, ClassLoader classLoader)
          Creates a new ClassPathResource for the given path using the specified ClassLoader.
 
Method Summary
 InputStream getInputStream()
          Creates an InputStream for this Resource.
 
Methods inherited from class org.spicefactory.lib.resource.AbstractResource
getPath
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ClassPathResource

public ClassPathResource(String path)
Creates a new ClassPathResource for the given path using the thread context ClassLoader.

Parameters:
path - the path within the class path

ClassPathResource

public ClassPathResource(String path,
                         ClassLoader classLoader)
Creates a new ClassPathResource for the given path using the specified ClassLoader.

Parameters:
path - the path within the class path

ClassPathResource

public ClassPathResource(String path,
                         Class<?> c)
Creates a new ClassPathResource for the given path using the specified Class to load the resource.

Parameters:
path - the path within the class path
c - the Class to use for loading the resource
Method Detail

getInputStream

public InputStream getInputStream()
Description copied from interface: Resource
Creates an InputStream for this Resource.

Returns:
an InputStream for this Resource