public interface ResourceLoader extends Sortable
A ResourceLoader
is a pluggable contract for loading resources.
Solder comes with a resource loader which uses the classpath to
locate resources, and a resource loader that uses the
ServletContext
(if available).
To register a custom ResourceLoader
you should implement this
interface, and register it as a ServiceProvider for the ResourceLoader
service.
ResourceProvider
,
Resource
Sortable.Comparator
Modifier and Type | Method and Description |
---|---|
URL |
getResource(String name)
Get the
URL for a resource. |
InputStream |
getResourceAsStream(String name)
Get the
InputStream for a resource. |
Collection<URL> |
getResources(String name)
Get the URLs known to all resource loaders for a given name.
|
Collection<InputStream> |
getResourcesAsStream(String name)
Get the input streams known to all resource loaders for a given name.
|
getPrecedence
URL getResource(String name)
Get the URL
for a resource.
The resource loaders are searched in precedence order, stopping when a resource is found.
name
- the resource to get the URL
forURL
, or null if the resource does not existRuntimeException
- if an error occurs loading the resourceInputStream getResourceAsStream(String name)
Get the InputStream
for a resource.
The resource loaders are searched in precedence order, stopping when a resource is found.
name
- the resource to get the InputStream
forInputStream
, or null if the resource does not existRuntimeException
- if an error occurs loading the resourceCollection<URL> getResources(String name)
Get the URLs known to all resource loaders for a given name.
name
- the resource to get the URLs forRuntimeException
- if an error occurs loading the resourceCollection<InputStream> getResourcesAsStream(String name)
Get the input streams known to all resource loaders for a given name.
name
- name the resource to get the input streams forRuntimeException
- if an error occurs loading the resourceCopyright © 2012 Seam Framework. All Rights Reserved.