public interface BrowsableLocation extends Location
Location
that offers methods to browse other locations relative to
it.Modifier and Type | Method and Description |
---|---|
BrowsableLocation |
child(String name)
Obtains a location with the given name, for whom this location is the
parent.
|
Set<BrowsableLocation> |
children()
Obtains a collection of locations for whom this location is the parent.
|
boolean |
isDirectory()
Tests whether this location is a directory, meaning that it can have
children.
|
BrowsableLocation |
parent()
Obtains a location pointing to the parent directory of this one.
|
BrowsableLocation |
sibling(String path)
Obtains a location relative to this one, which will be configured
like the current location, but point to a the file specified by the
path parameter. |
defaultName, getName, getURI
BrowsableLocation parent() throws IOException
null
if this
location has no parent.IOException
- if something goes wrong obtaining the parent.Set<BrowsableLocation> children() throws IOException
isDirectory()
on this
location return true
.Collections.EMPTY_SET
if this location has no children.IOException
- if something goes wrong obtaining the children.IllegalArgumentException
- if this location is not a directory (i.e.,
isDirectory()
returns false).BrowsableLocation sibling(String path) throws IOException
path
parameter.path
- the relative path of the desired location.IOException
- if something goes wrong obtaining the siblingboolean isDirectory()
child(String)
or children()
, to ensure those calls
succeed.BrowsableLocation child(String name) throws IOException
isDirectory()
on this location return true
.name
- the name of the childIOException
- if something goes wrong obtaining the child.IllegalArgumentException
- if this location is not a directory (i.e.,
isDirectory()
returns false).Copyright © 2015–2022 SciJava. All rights reserved.