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, openOutputStream
getLastModificationDate, getName, getPath, getSize, getUri, getUrl, isAvailable, isData, isModifiedSince, openStream, toString
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getLastModificationDate, getName, getPath, getSize, getUri, getUrl, isAvailable, isData, isModifiedSince, openStream
private final BrowsableResource delegate
public BrowsableResourceAdapter(BrowsableResource delegate)
delegate
- is the BrowsableResource
to adapt.protected BrowsableResource getDelegate()
AbstractDataResourceProxy
DataResource
this proxy delegates to.getDelegate
in class AbstractBrowsableResourceProxy
public DataResource navigate(String relativePath) throws ResourceUriUndefinedException
DataResource
DataResource
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 DataResource
navigate
in class AbstractDataResourceProxy
relativePath
- 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)
BrowsableResource
cd
in interface BrowsableResource
cd
in class AbstractBrowsableResourceProxy
path
- 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.