Class IOAccess.Builder

java.lang.Object
org.graalvm.polyglot.io.IOAccess.Builder
Enclosing class:
IOAccess

public static final class IOAccess.Builder extends Object
Builder to create a custom IO access configuration.
Since:
23.0
  • Method Details

    • allowHostFileAccess

      public IOAccess.Builder allowHostFileAccess(boolean allow)
      If true, it allows the guest language unrestricted access to files on the host system.
      Since:
      23.0
    • allowHostSocketAccess

      public IOAccess.Builder allowHostSocketAccess(boolean allow)
      If true, it allows the guest language unrestricted access to host system sockets.
      Since:
      23.0
    • fileSystem

      public IOAccess.Builder fileSystem(FileSystem fileSystem)
      Sets a new FileSystem. Access to the file system in the guest language will be virtualized using the fileSystem. A file system can restrict access to files or fully virtualize file system operations. An example of virtualization is a memory-based file system.
      Parameters:
      fileSystem - the file system to use in the guest language
      Returns:
      the IOAccess.Builder
      Since:
      23.0
    • build

      public IOAccess 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