Package org.graalvm.polyglot.io
Class FileSystem.Selector
java.lang.Object
org.graalvm.polyglot.io.FileSystem.Selector
- Enclosing interface:
FileSystem
A selector for determining which
FileSystem
should handle operations on a given
Path
. This class encapsulates a FileSystem
and defines a condition for
selecting it.- Since:
- 24.2
-
Constructor Summary
ModifierConstructorDescriptionprotected
Selector
(FileSystem fileSystem) Creates aFileSystem.Selector
for the specifiedFileSystem
. -
Method Summary
Modifier and TypeMethodDescriptionfinal FileSystem
Returns theFileSystem
associated with this selector.static FileSystem.Selector
of
(FileSystem fileSystem, Predicate<Path> predicate) abstract boolean
Tests whether theFileSystem
associated with this selector can handle operations on the specifiedPath
.
-
Constructor Details
-
Selector
Creates aFileSystem.Selector
for the specifiedFileSystem
.- Since:
- 24.2
-
-
Method Details
-
getFileSystem
Returns theFileSystem
associated with this selector.- Since:
- 24.2
-
test
Tests whether theFileSystem
associated with this selector can handle operations on the specifiedPath
.- Specified by:
test
in interfacePredicate<Path>
- Parameters:
path
- the path to test, provided as a normalized absolute path. The givenpath
has no path components equal to"."
or".."
.- Returns:
true
if the associatedFileSystem
can handle thepath
;false
otherwise- Since:
- 24.2
-
of
- Parameters:
fileSystem
- theFileSystem
to associate with the selectorpredicate
- the condition to determine if theFileSystem
can handle a given path- Returns:
- a new
FileSystem.Selector
that delegates path testing to thepredicate
- Since:
- 24.2
-