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

java.lang.Object
  extended by net.sf.mmm.util.resource.base.AbstractDataResourceProxy
      extended by net.sf.mmm.util.resource.base.AbstractDataResourceFactory.DataResourceAdapter
All Implemented Interfaces:
DataResource
Enclosing class:
AbstractDataResourceFactory

protected class AbstractDataResourceFactory.DataResourceAdapter
extends AbstractDataResourceProxy

This is an implementation of the DataResource interface, that adapts another DataResource and enhances the navigate(String)-method to support switching schemes via the DataResourceFactory that created this DataResource.

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

Field Summary
private  DataResource delegate
           
 
Constructor Summary
AbstractDataResourceFactory.DataResourceAdapter(DataResource delegate)
          The constructor.
 
Method Summary
protected  DataResource getDelegate()
          This method gets the DataResource this proxy delegates to.
 DataResource navigate(String relativePath)
          This method creates a new DataResource pointing to the given resourcePath based on this resource.
 
Methods inherited from class net.sf.mmm.util.resource.base.AbstractDataResourceProxy
getLastModificationDate, getName, getPath, getSize, getUri, getUrl, isAvailable, isData, isModifiedSince, openOutputStream, openStream, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

delegate

private final DataResource delegate
See Also:
getDelegate()
Constructor Detail

AbstractDataResourceFactory.DataResourceAdapter

public AbstractDataResourceFactory.DataResourceAdapter(DataResource delegate)
The constructor.

Parameters:
delegate - is the DataResource to adapt.
Method Detail

getDelegate

protected DataResource getDelegate()
This method gets the DataResource this proxy delegates to.

Specified by:
getDelegate in class AbstractDataResourceProxy
Returns:
the delegate.

navigate

public DataResource navigate(String relativePath)
                      throws ResourceUriUndefinedException
This method creates a new DataResource pointing to the given resourcePath based on this resource.
E.g. if this resource points to the file "/etc/init.d/rc" and relativePath would be "../apt/sources.list" the resulting resource would point to "/etc/apt/sources.list".

Specified by:
navigate in interface DataResource
Overrides:
navigate in class AbstractDataResourceProxy
Parameters:
relativePath - is the absolute or relative path pointing to a new resource. If it is a relative path, it is interpreted relative to the parent URI (directory) of this resource.
Returns:
is the resource pointing to the given path (relative to this resource).
Throws:
ResourceUriUndefinedException - if the given resourcePath leads to an undefined or illegal URI.


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