net.sf.mmm.util.resource.api
Interface DataResourceFactory

All Known Subinterfaces:
BrowsableResourceFactory
All Known Implementing Classes:
AbstractBrowsableResourceFactory, AbstractDataResourceFactory, BrowsableResourceFactoryImpl, DataResourceFactoryImpl

@ComponentSpecification
public interface DataResourceFactory

This is the interface for a factory used to create DataResources.
If you want to read resources from configurable locations, you should use this factory. In situations where you want to load a resource, for which you already know the location (e.g. from a specific classpath location) and you are going to wire the location into your code, you can bypass this factory and simply create a new instance of the according DataResource -implementation (e.g. ClasspathResource ).

Since:
1.0.2
Author:
Joerg Hohwiller (hohwille at users.sourceforge.net)

Method Summary
 DataResource createDataResource(String resourceUri)
          This method creates a new DataResource from the given resourceUri.
 

Method Detail

createDataResource

DataResource createDataResource(String resourceUri)
                                throws ResourceUriUndefinedException
This method creates a new DataResource from the given resourceUri. The following URI-schemes are guaranteed to be supported:
scheme example URI default implementation
file file:///tmp/foo.xml FileResource
classpath classpath:net/sf/mmm/util/beans-core.xml ClasspathResource
ftp|http|https|... (whatever supported by URL) http://m-m-m.sourceforge.net/maven/ UrlResource

Parameters:
resourceUri - is the absolute URI pointing to the location of the requested DataResource.
Returns:
the requested DataResource.
Throws:
ResourceUriUndefinedException - if the given resourceUri is undefined (e.g. the scheme is NOT supported).


Copyright © 2001-2010 mmm-Team. All Rights Reserved.