org.jbehave.web.io
Class ResourceFinder
java.lang.Object
org.jbehave.web.io.ResourceFinder
public class ResourceFinder
- extends 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.
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
DEFAULT_ROOT_DIRECTORY
public static final String DEFAULT_ROOT_DIRECTORY
- See Also:
- Constant Field Values
DEFAULT_CLASSPATH_PREFIX
public static final String DEFAULT_CLASSPATH_PREFIX
- See Also:
- Constant Field Values
ResourceFinder
public ResourceFinder()
ResourceFinder
public ResourceFinder(String rootDirectory)
ResourceFinder
public ResourceFinder(ClassLoader classLoader,
String rootDirectory)
ResourceFinder
public ResourceFinder(ClassLoader classLoader,
String rootDirectory,
String classpathPrefix)
resourceAsString
public String resourceAsString(String relativePath)
useRootDirectory
public void useRootDirectory(String rootDirectory)
Copyright © 2012. All Rights Reserved.