---
title: "FileSystem.Selector"
description: "A selector for determining which FileSystem should handle operations on a given Path."
kind: "abstract class"
id: "org.graalvm.polyglot.io.FileSystem$Selector"
module: "polyglot"
version: "25.6.0-elide.4"
canonical: "https://graalvm.elide.help/25.6.0-elide.4/api/polyglot/org/graalvm/polyglot/io/FileSystem.Selector.html"
---

# ◆ FileSystem.Selector

[polyglot](../../../../index.md) › [org.graalvm.polyglot.io](index.md) · Every page: [llms.txt](../../../../llms.txt)

Abstract class in [`org.graalvm.polyglot.io`](index.md). Since 24.2. Nested in [`FileSystem`](FileSystem.md).

```java
public abstract class FileSystem.Selector implements Predicate<Path>
```

Inheritance: [`Object`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html) > `Selector`

Implements: [`Predicate`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/util/function/Predicate.html)`<`[`Path`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/nio/file/Path.html)`>`

A selector for determining which [`FileSystem`](FileSystem.md) should handle operations on a given [`Path`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/nio/file/Path.html). This class encapsulates a [`FileSystem`](FileSystem.md) and defines a condition for selecting it.

## Constructors

### Selector(FileSystem)
<a id="&lt;init&gt;(org.graalvm.polyglot.io.FileSystem)"></a>`protected Selector(FileSystem fileSystem)`. Since 24.2. Creates a `Selector` for the specified `FileSystem`. Cite: `org/graalvm/polyglot/io/FileSystem.Selector.html#<init>(org.graalvm.polyglot.io.FileSystem)`

## Methods

### getFileSystem()
<a id="getFileSystem()"></a>`public final FileSystem getFileSystem()`. Since 24.2. Returns the `FileSystem` associated with this selector. Cite: `org/graalvm/polyglot/io/FileSystem.Selector.html#getFileSystem()`

### test(Path)
<a id="test(java.nio.file.Path)"></a>`public abstract boolean test(Path path)`. Since 24.2. Tests whether the `FileSystem` associated with this selector can handle operations on the specified [`Path`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/nio/file/Path.html). Parameters: `path` `Path`: the path to test, provided as a normalized absolute path. The given `path` has no path components equal to `"."` or `".."`. Returns `boolean`: `true` if the associated `FileSystem` can handle the `path`; `false` otherwise. Overrides `test(T)`. Cite: `org/graalvm/polyglot/io/FileSystem.Selector.html#test(java.nio.file.Path)`

### of(FileSystem, Predicate)
<a id="of(org.graalvm.polyglot.io.FileSystem,java.util.function.Predicate)"></a>`public static FileSystem.Selector of(FileSystem fileSystem, Predicate<Path> predicate)`. Since 24.2. Creates a `Selector` for the specified `FileSystem` using the provided [`Predicate`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/util/function/Predicate.html). Parameters: `fileSystem` `FileSystem`: the `FileSystem` to associate with the selector. `predicate` `Predicate<Path>`: the condition to determine if the `FileSystem` can handle a given path. Returns `FileSystem.Selector`: a new `Selector` that delegates path testing to the `predicate`. Cite: `org/graalvm/polyglot/io/FileSystem.Selector.html#of(org.graalvm.polyglot.io.FileSystem,java.util.function.Predicate)`

## Inherited members

- From class [`Object`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html): [`clone`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#clone%28%29), [`equals`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#equals%28java.lang.Object%29), [`finalize`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#finalize%28%29), [`getClass`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#getClass%28%29), [`hashCode`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#hashCode%28%29), [`notify`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#notify%28%29), [`notifyAll`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#notifyAll%28%29), [`toString`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#toString%28%29), [`wait`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#wait%28%29), [`wait`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#wait%28long%29), [`wait`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#wait%28long,int%29)
- From interface [`Predicate`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/util/function/Predicate.html): [`and`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/util/function/Predicate.html#and%28java.util.function.Predicate%29), [`negate`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/util/function/Predicate.html#negate%28%29), [`or`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/util/function/Predicate.html#or%28java.util.function.Predicate%29)
