org.jbehave.web.io
Class ResourceFinder
java.lang.Object
org.jbehave.web.io.ResourceFinder
public class ResourceFinder
- extends java.lang.Object
A utility class to retrieve resource, either from classpath or from
filesystem, and convert them to strings. Classpath resources are identified
by a configurable classpath prefix, which defaults to "classpath:". The
finder will resolve the resource path (i.e. stripping the prefix) and first
try to find the resource in the injected classloader, which default the
current thread context classloader, and failing that will fall back on
looking for the resource in the filesystem.
|
Constructor Summary |
ResourceFinder(java.lang.ClassLoader classLoader,
java.lang.String rootDirectory)
|
ResourceFinder(java.lang.ClassLoader classLoader,
java.lang.String rootDirectory,
java.lang.String classpathPrefix)
|
ResourceFinder(java.lang.String rootDirectory)
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
DEFAULT_CLASSPATH_PREFIX
public static final java.lang.String DEFAULT_CLASSPATH_PREFIX
- See Also:
- Constant Field Values
ResourceFinder
public ResourceFinder(java.lang.String rootDirectory)
ResourceFinder
public ResourceFinder(java.lang.ClassLoader classLoader,
java.lang.String rootDirectory)
ResourceFinder
public ResourceFinder(java.lang.ClassLoader classLoader,
java.lang.String rootDirectory,
java.lang.String classpathPrefix)
resourceAsString
public java.lang.String resourceAsString(java.lang.String relativePath)
useRootDirectory
public void useRootDirectory(java.lang.String rootDirectory)
Copyright © 2010. All Rights Reserved.