Class IOAccess.Builder
java.lang.Object
org.graalvm.polyglot.io.IOAccess.Builder
- Enclosing class:
IOAccess
Builder to create a custom
IO access configuration.- Since:
- 23.0
-
Method Summary
Modifier and TypeMethodDescriptionallowHostFileAccess(boolean allow) Iftrue, it allows the guest language unrestricted access to files on the host system.allowHostSocketAccess(boolean allow) Iftrue, it allows the guest language unrestricted access to host system sockets.build()Creates an instance of the custom IO access configuration.fileSystem(FileSystem fileSystem) Sets a newFileSystem.toString()
-
Method Details
-
allowHostFileAccess
Iftrue, it allows the guest language unrestricted access to files on the host system.- Since:
- 23.0
-
allowHostSocketAccess
Iftrue, it allows the guest language unrestricted access to host system sockets.- Since:
- 23.0
-
fileSystem
Sets a newFileSystem. Access to the file system in the guest language will be virtualized using thefileSystem. A file system can restrict access to files or fully virtualize file system operations. An example of virtualization is a memory-based file system.GraalVM trusts a custom file system supplied by the embedder. Its methods may be invoked with guest-controlled input, so the embedder must ensure that the implementation is safe for use with the selected
sandbox policy. Sandbox validation rejects file systems known to expose the default host file system, but it does not inspect the behavior of arbitrary custom implementations.- Parameters:
fileSystem- the file system to use in the guest language- Returns:
- the
IOAccess.Builder - Since:
- 23.0
-
toString
-
build
Creates an instance of the custom IO access configuration.- Throws:
IllegalArgumentException- if host file access is enabled and a custom file system is set.- Since:
- 23.0
-