protected class AbstractBrowsableResourceFactory.BrowsableResourceAdapter extends AbstractBrowsableResourceProxy
BrowsableResource interface, that adapts another
BrowsableResource and enhances the navigate(String)-method to support switching schemes via the
BrowsableResourceFactory that created this BrowsableResource.| Modifier and Type | Field and Description |
|---|---|
private BrowsableResource |
delegate |
| Constructor and Description |
|---|
BrowsableResourceAdapter(BrowsableResource delegate)
The constructor.
|
| Modifier and Type | Method and Description |
|---|---|
BrowsableResource |
cd(String path)
|
protected BrowsableResource |
getDelegate()
This method gets the
DataResource this proxy delegates to. |
DataResource |
navigate(String relativePath)
This method retrieves a
DataResource pointing to the given resourcePath based on this resource.E.g. |
getChildResources, getChildResources, isFolder, openOutputStreamgetLastModificationDate, getName, getPath, getSize, getUri, getUrl, isAvailable, isData, isModifiedSince, openStream, toStringclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitgetLastModificationDate, getName, getPath, getSize, getUri, getUrl, isAvailable, isData, isModifiedSince, openStreamprivate final BrowsableResource delegate
public BrowsableResourceAdapter(BrowsableResource delegate)
delegate - is the BrowsableResource to adapt.protected BrowsableResource getDelegate()
AbstractDataResourceProxyDataResource this proxy delegates to.getDelegate in class AbstractBrowsableResourceProxypublic DataResource navigate(String relativePath) throws ResourceUriUndefinedException
DataResourceDataResource pointing to the given resourcePath based on this resource.resourcePath would be "../apt/sources.list"
the resulting resource would point to "/etc/apt/sources.list". folder of this resource. This will also be the case if this resource itself is
a folder. Due to this generic API this is the only consistent way as there are
implementations that can not easily know if they represent a folder or a
file or maybe even both at the same time. However, please be aware of this and
do not get confused as you might expect this to be a cd command if invoked on
a folder what is not exactly not the case (instead it is a
cd on the parent folder). On a BrowsableResource you can use
BrowsableResource.cd(String) instead to avoid confusion.navigate in interface DataResourcenavigate in class AbstractDataResourceProxyrelativePath - 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.ResourceUriUndefinedException - if the given resourcePath leads to an undefined or illegal URI.BrowsableResource.cd(String)public BrowsableResource cd(String path)
BrowsableResourcecd in interface BrowsableResourcecd in class AbstractBrowsableResourceProxypath - the absolute or relative path pointing to a new resource. If it is a relative path, it is interpreted
relative to the current URI (directory) if this is a folder and relative to the parent
URI otherwise.DataResource.navigate(String)Copyright © 2001–2016 mmm-Team. All rights reserved.