|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jboss.seam.solder.resourceLoader.ResourceLoaderManager
public class ResourceLoaderManager
ResourceLoaderManager
discovers and instantiates all
ResourceLoader
s defined. It also provides accesss to these resources,
either as URL
s or InputStream
s.
If you are working in a CDI managed environment, you should use
ResourceProvider
instead, as it provides automatic, contextual
management of resources. If you are outside a CDI managed environment, then
instantiating ResourceLoaderManager
provides access to the same
resources.
ResourceLoader
,
ResourceProvider
Constructor Summary | |
---|---|
ResourceLoaderManager()
Instantiate a new instance, loading any resource loaders from the service loader, and sorting them by precedence. |
Method Summary | |
---|---|
Properties |
getPropertiesBundle(String name)
Load a properties bundle by name. |
Collection<Properties> |
getPropertiesBundles(String name)
Load all properties bundles known to the resource loader by name. |
URL |
getResource(String name)
Load a resource by name. |
InputStream |
getResourceAsStream(String name)
Load a resource by name. |
Iterable<ResourceLoader> |
getResourceLoaders()
The discovered ResourceLoader instances. |
Collection<URL> |
getResources(String name)
Load all resources known to the resource loader by name. |
Collection<InputStream> |
getResourcesAsStream(String name)
Load all resources known to the resource loader by name. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ResourceLoaderManager()
Method Detail |
---|
public Iterable<ResourceLoader> getResourceLoaders()
ResourceLoader
instances.
public URL getResource(String name)
Load a resource by name.
The resource loaders will be searched in precedence order, the first result found being returned.
name
- the resource to load
null
if no
resource can be loaded
RuntimeException
- if an error occurs loading the resourcepublic Properties getPropertiesBundle(String name)
Load a properties bundle by name.
The resource loaders will be searched in precedence order, the first result found being returned.
name
- the name of the properties bundle to load
RuntimeException
- if an error occurs loading the properties bundlepublic Collection<Properties> getPropertiesBundles(String name)
Load all properties bundles known to the resource loader by name.
name
- the name of the properties bundle to load
RuntimeException
- if an error occurs loading the properties bundlespublic InputStream getResourceAsStream(String name)
Load a resource by name.
The resource loaders will be searched in precedence order, the first result found being returned.
name
- the resource to load
null
if no resource can be loaded
RuntimeException
- if an error occurs loading the resourcepublic Collection<URL> getResources(String name)
Load all resources known to the resource loader by name.
name
- the resource to load
RuntimeException
- if an error occurs loading the resourcepublic Collection<InputStream> getResourcesAsStream(String name)
Load all resources known to the resource loader by name.
name
- the resource to load
RuntimeException
- if an error occurs loading the resource
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |