Class IOAccess

java.lang.Object
org.graalvm.polyglot.io.IOAccess

public final class IOAccess extends Object
Represents an IO access configuration of a polyglot context. The IO access configuration determines how a guest language can access the host IO. The access to host IO can be disabled, enabled, or virtualized using a custom file system.
Since:
23.0
  • Field Details

    • NONE

      public static final IOAccess NONE
      Provides guest language no access to IO. Guest language only has read-only access to the language's home files. The NONE is a default value for Contexts created without all access. If you are using this preset, the newly added privileges will default to false for this preset.

      Equivalent of using the following builder configuration:

       
       IOAccess.newBuilder().build();
       
       
      Since:
      23.0
    • ALL

      public static final IOAccess ALL
      Provides guest language full access to host IO. Guest language have full access to host file system and host sockets. The ALL is a default value for Contexts created with all access set to true. If you are using this preset, the newly added privileges will default to true for this preset.

      Equivalent of using the following builder configuration:

       
       IOAccess.newBuilder()
                 .allowHostFileAccess(true)
                 .allowHostSocketAccess(true)
                 .build();
       
       
      Since:
      23.0
  • Method Details

    • newBuilder

      public static IOAccess.Builder newBuilder()
      Creates a new builder that allows to create a custom IO access configuration. The builder configuration needs to be completed using the method.
      Since:
      23.0
    • newBuilder

      public static IOAccess.Builder newBuilder(IOAccess prototype)
      Creates a new builder that allows to create a custom IO access configuration based of a preset configuration. The preset configuration is copied and used as a template for the returned builder. The builder configuration needs to be completed using the method.
      Since:
      23.0
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
      Since:
      23.0
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
      Since:
      23.0
    • toString

      public String toString()
      Overrides:
      toString in class Object
      Since:
      23.0