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
ConstructorsModifierConstructorDescriptionprotectedSelector(FileSystem fileSystem) Creates aFileSystem.Selectorfor the specifiedFileSystem. -
Method Summary
Modifier and TypeMethodDescriptionfinal FileSystemReturns theFileSystemassociated with this selector.static FileSystem.Selectorof(FileSystem fileSystem, Predicate<Path> predicate) abstract booleanTests whether theFileSystemassociated with this selector can handle operations on the specifiedPath.
-
Constructor Details
-
Selector
Creates aFileSystem.Selectorfor the specifiedFileSystem.- Since:
- 24.2
-
-
Method Details
-
getFileSystem
Returns theFileSystemassociated with this selector.- Since:
- 24.2
-
test
Tests whether theFileSystemassociated with this selector can handle operations on the specifiedPath.- Specified by:
testin interfacePredicate<Path>- Parameters:
path- the path to test, provided as a normalized absolute path. The givenpathhas no path components equal to"."or"..".- Returns:
trueif the associatedFileSystemcan handle thepath;falseotherwise- Since:
- 24.2
-
of
- Parameters:
fileSystem- theFileSystemto associate with the selectorpredicate- the condition to determine if theFileSystemcan handle a given path- Returns:
- a new
FileSystem.Selectorthat delegates path testing to thepredicate - Since:
- 24.2
-