|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.easetech.easytest.io.ResourceLoaderStrategy
public class ResourceLoaderStrategy
Implementation of the ResourceLoader that defines a strategy to load different types of resources based on
user provided values. It loads three different types of resources :
ClasspathResource - Resource
representing the Classpath based resources(prefixed with classpath:)FileSystemResource - Resource
based on FileSystem (for eg. in your C: drive)UrlResource - Resource based on URL (http for eg)
| Field Summary | |
|---|---|
protected static org.slf4j.Logger |
LOG
An instance of logger associated with the test framework. |
| Fields inherited from interface org.easetech.easytest.io.ResourceLoader |
|---|
CLASSPATH_PREFIX, FILE_PREFIX, URL_PREFIX |
| Constructor Summary | |
|---|---|
ResourceLoaderStrategy()
Construct a new ResourceLoaderStrategy |
|
ResourceLoaderStrategy(Class classObj)
Construct a new ResourceLoaderStrategy |
|
ResourceLoaderStrategy(ClassLoader classLoader)
Construct a new ResourceLoaderStrategy |
|
ResourceLoaderStrategy(ClassLoader classLoader,
Class classObj)
Construct a new ResourceLoaderStrategy |
|
| Method Summary | |
|---|---|
ClassLoader |
getClassLoader()
Get the associated ClassLoader |
Class<?> |
getClassObj()
|
Resource |
getResource(String location)
Get the resource based on the location. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected static final org.slf4j.Logger LOG
| Constructor Detail |
|---|
public ResourceLoaderStrategy()
public ResourceLoaderStrategy(Class classObj)
classObj - the class objectpublic ResourceLoaderStrategy(ClassLoader classLoader)
classLoader - the class loaderpublic ResourceLoaderStrategy(ClassLoader classLoader, Class classObj)
classLoader - classObj - | Method Detail |
|---|
public Resource getResource(String location)
ClasspathResource instance
based on the provided location.UrlResource. If the
UrlResource cannot be created due to MalformedURLException then we return a
FileSystemResource instance and pray to God that it works :)
getResource in interface ResourceLoaderlocation - the location of the resource
Resource instance.public ClassLoader getClassLoader()
getClassLoader in interface ResourceLoaderpublic Class<?> getClassObj()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||