Package: java.lang

## [Java] Class String[]

- java.lang.String[]

-     public class String[]
      extends Object

  GDK enhancements for String[].

  displayName:
    String[]
  receiverFqcn:
    java.lang.String[]

- - ### Methods Summary

    Methods
    Type Params | Return Type | Name and description
    --- | --- | ---
    `` | `public Process` | `execute()` Executes the command specified by the given `String` array.
    `` | `public Process` | `execute(String[] envp, File dir)` Executes the command specified by the `String` array given in the first parameter, with the environment defined by `envp` and under the working directory `dir`.
    `` | `public Process` | `execute(List envp, File dir)` Executes the command specified by the `String` array given in the first parameter, with the environment defined by `envp` and under the working directory `dir`.
    `` | `public Process` | `execute(Map<String, Object> options)` Executes the command specified by the given `String` array with options provided as named parameters.
    `` | `public ProcessBuilder` | `toProcessBuilder()` Creates a ProcessBuilder from a command array.

  - ### Inherited Methods Summary

    Inherited Methods
    Methods inherited from class | Name
    --- | ---
    `class Object` | `addShutdownHook, any, any, asBoolean, asType, collect, collect, collect, dump, each, eachMatch, eachMatch, eachWithIndex, every, every, find, find, findAll, findAll, findIndexOf, findIndexOf, findIndexValues, findIndexValues, findLastIndexOf, findLastIndexOf, findResult, findResult, findResult, findResult, getAt, getMetaClass, getMetaPropertyValues, getProperties, grep, grep, hasProperty, identity, inject, inject, inspect, invokeMethod, is, isCase, isNotCase, iterator, metaClass, print, print, printf, printf, println, println, println, putAt, respondsTo, respondsTo, setMetaClass, sleep, sleep, split, sprintf, sprintf, stream, tap, toString, use, use, use, with, with, withCloseable, withCloseable, withMethodClosure, withStream, withStream, withTraits`

- - ### Method Detail

    - #### public Process execute()

      Executes the command specified by the given `String` array. The first item in the array is the command; the others are the parameters.

      For more control over Process construction you can use `java.lang.ProcessBuilder`.

      throws:
        IOException if an IOException occurs.
      Returns:
        the Process which has just started for this command line representation.
      Since:
        1.0

    - #### public Process execute(String[] envp, File dir)

      Executes the command specified by the `String` array given in the first parameter, with the environment defined by `envp` and under the working directory `dir`. The first item in the array is the command; the others are the parameters.

      For more control over Process construction you can use `java.lang.ProcessBuilder`.

      throws:
        IOException if an IOException occurs.
      Parameters:
        `envp` - an array of Strings, each member of which has environment variable settings in the format name=value, or `null` if the subprocess should inherit the environment of the current process.
        `dir` - the working directory of the subprocess, or `null` if the subprocess should inherit the working directory of the current process.
      Returns:
        the Process which has just started for this command line representation.
      Since:
        1.7.1

    - #### public Process execute(List envp, File dir)

      Executes the command specified by the `String` array given in the first parameter, with the environment defined by `envp` and under the working directory `dir`. The first item in the array is the command; the others are the parameters.

      For more control over Process construction you can use `java.lang.ProcessBuilder`.

      throws:
        IOException if an IOException occurs.
      Parameters:
        `envp` - a List of Objects (converted to Strings using toString), each member of which has environment variable settings in the format name=value, or `null` if the subprocess should inherit the environment of the current process.
        `dir` - the working directory of the subprocess, or `null` if the subprocess should inherit the working directory of the current process.
      Returns:
        the Process which has just started for this command line representation.
      Since:
        1.7.1

    - #### public Process execute(Map<String, Object> options)

      Executes the command specified by the given `String` array with options provided as named parameters.

      throws:
        IOException if an IOException occurs.
      Parameters:
        `options` - a Map of options to configure the process (see String.execute)
      Returns:
        the Process which has just started
      Since:
        6.0.0
      See Also:
        execute(String, Map)

    - #### public ProcessBuilder toProcessBuilder()

      Creates a ProcessBuilder from a command array.

      Returns:
        a ProcessBuilder ready to be configured further or started
      Since:
        6.0.0