public interface BrowsableResource extends DataResource
DataResource
that has higher-level features and may contain other resources. You
can think of a BrowsableResource
as a file
that is a directory
or a regular file
. However it may be both and it can originate from other
sources than the filesystem. It was created before Path
was available and a migration was
started but failed due to design restrictions of NIO. However, this API is more lightweight than
Path
and especially FileSystem
that also prevents some scenarios such as
creating a sub-filesystem where the root is some sub-folder of the main filesystem.data
containing the HTML-content as well as a folder
containing the linked sites. Further you have to be careful when recursively scanning BrowsableResource
s that
you avoid infinity loops. E.g. create a Set
holding the URIs
of the
BrowsableResource
s that have already been visited in case you are completely abstracting from the source of
the data.Modifier and Type | Method and Description |
---|---|
BrowsableResource |
cd(String path)
|
Iterable<? extends BrowsableResource> |
getChildResources()
This method iterates the immediate child-
resources contained in this
BrowsableResource . |
Iterable<? extends BrowsableResource> |
getChildResources(Filter<? super BrowsableResource> filter)
This method iterates the immediate child-
resources contained in this
BrowsableResource and are accepted by the given filter . |
boolean |
isFolder()
This method determines if this
BrowsableResource is a folder that potentially contains other
resources . |
getLastModificationDate, getName, getPath, getSize, getUri, getUrl, isAvailable, isData, isModifiedSince, navigate, openOutputStream, openStream
Iterable<? extends BrowsableResource> getChildResources()
resources
contained in this
BrowsableResource
. folder
, this method will always return an empty Iterable
.Iterable<? extends BrowsableResource> getChildResources(Filter<? super BrowsableResource> filter)
resources
contained in this
BrowsableResource
and are accepted
by the given filter
. filter
- is the Filter
applied to the child-resources
.Iterable
of the child-resources
.boolean isFolder()
BrowsableResource
is a folder that potentially contains other
resources
. Otherwise if this is no folder, getChildResources()
will be empty
(return an empty Iterable
). However getChildResources()
can also be empty, if this is a folder.
BrowsableResource
is containing data
, please use
DataResource.isAvailable()
. Please note that isFolder()
and DataResource.isAvailable()
can both return
true
or both return false
.true
if this is a folder, false
otherwise.BrowsableResource cd(String path)
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.