net.sf.mmm.util.resource.base
Class AbstractBrowsableResourceFactory.BrowsableResourceAdapter

java.lang.Object
  extended by net.sf.mmm.util.resource.base.AbstractDataResourceProxy
      extended by net.sf.mmm.util.resource.base.AbstractBrowsableResourceProxy
          extended by net.sf.mmm.util.resource.base.AbstractBrowsableResourceFactory.BrowsableResourceAdapter
All Implemented Interfaces:
BrowsableResource, DataResource
Enclosing class:
AbstractBrowsableResourceFactory

protected class AbstractBrowsableResourceFactory.BrowsableResourceAdapter
extends AbstractBrowsableResourceProxy

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

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

Field Summary
private  BrowsableResource delegate
           
 
Constructor Summary
AbstractBrowsableResourceFactory.BrowsableResourceAdapter(BrowsableResource delegate)
          The constructor.
 
Method Summary
protected  BrowsableResource 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.AbstractBrowsableResourceProxy
getChildResources, getChildResources, isFolder, openOutputStream
 
Methods inherited from class net.sf.mmm.util.resource.base.AbstractDataResourceProxy
getLastModificationDate, getName, getPath, getSize, getUri, getUrl, isAvailable, isData, isModifiedSince, openStream, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface net.sf.mmm.util.resource.api.DataResource
getLastModificationDate, getName, getPath, getSize, getUri, getUrl, isAvailable, isData, isModifiedSince, openStream
 

Field Detail

delegate

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

AbstractBrowsableResourceFactory.BrowsableResourceAdapter

public AbstractBrowsableResourceFactory.BrowsableResourceAdapter(BrowsableResource delegate)
The constructor.

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

getDelegate

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

Specified by:
getDelegate in class AbstractBrowsableResourceProxy
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.