Package com.bc.ceres.core
Class DefaultResourceLocator
- java.lang.Object
-
- com.bc.ceres.core.ResourceLocator
-
- com.bc.ceres.core.DefaultResourceLocator
-
public class DefaultResourceLocator extends ResourceLocator
The default resource locator. Locates resources using the current context class loader. Can be easily subclassed by overridinggetResourceClassLoader()
in order to return an appropriate class loader.
-
-
Constructor Summary
Constructors Constructor Description DefaultResourceLocator()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected ClassLoader
getResourceClassLoader()
The default implementation returns the context class loader.Collection<Path>
locateResources(String name)
Locates all resources with the given name.protected Path
toPath(URI uri)
-
Methods inherited from class com.bc.ceres.core.ResourceLocator
getResources
-
-
-
-
Field Detail
-
LOG
public static final Logger LOG
-
-
Method Detail
-
locateResources
public Collection<Path> locateResources(String name)
Description copied from class:ResourceLocator
Locates all resources with the given name.- Specified by:
locateResources
in classResourceLocator
- Parameters:
name
- The resource name- Returns:
- The collection of all resources located
-
getResourceClassLoader
protected ClassLoader getResourceClassLoader()
The default implementation returns the context class loader.- Returns:
- the class loader used to load resources.
-
toPath
protected Path toPath(URI uri) throws IOException
- Throws:
IOException
-
-