net.sf.mmm.util.resource.base
Class AbstractDataResourceFactory

java.lang.Object
  extended by net.sf.mmm.util.component.base.AbstractComponent
      extended by net.sf.mmm.util.component.base.AbstractLoggableComponent
          extended by net.sf.mmm.util.resource.base.AbstractDataResourceFactory
All Implemented Interfaces:
DataResourceFactory
Direct Known Subclasses:
AbstractBrowsableResourceFactory, DataResourceFactoryImpl

public abstract class AbstractDataResourceFactory
extends AbstractLoggableComponent
implements DataResourceFactory

This is the abstract base implementation of the DataResourceFactory interface.

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

Nested Class Summary
protected  class AbstractDataResourceFactory.DataResourceAdapter
          This is an implementation of the DataResource interface, that adapts another DataResource and enhances the AbstractDataResourceFactory.DataResourceAdapter.navigate(String)-method to support switching schemes via the DataResourceFactory that created this DataResource.
 
Constructor Summary
AbstractDataResourceFactory()
          The constructor.
 
Method Summary
protected abstract  DataResource createDataResource(ResourceUri resourceUri)
          This method creates the actual raw DataResource.
 DataResource createDataResource(String resourceUri)
          This method creates a new DataResource from the given resourceUri.
 
Methods inherited from class net.sf.mmm.util.component.base.AbstractLoggableComponent
doInitialize, getLogger, setLogger
 
Methods inherited from class net.sf.mmm.util.component.base.AbstractComponent
doInitialized, getInitializationState, initialize
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractDataResourceFactory

public AbstractDataResourceFactory()
The constructor.

Method Detail

createDataResource

public 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

Specified by:
createDataResource in interface DataResourceFactory
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).

createDataResource

protected abstract DataResource createDataResource(ResourceUri resourceUri)
                                            throws ResourceUriUndefinedException
This method creates the actual raw DataResource.

Parameters:
resourceUri - is the parsed and qualified ResourceUriImpl.
Returns:
the created DataResource.
Throws:
ResourceUriUndefinedException - if the given resourceUri is undefined, e.g. the scheme-prefix is NOT supported by this factory.


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