Class ProcessBuilder
java.lang.Object
com.codename1.io.ProcessBuilder
Creates desktop/backend subprocesses using JavaSE-style command lists and pipes. The working directory is an OS path String, not a Codename One file URL. Shell parsing is never implicit: invoke a shell explicitly if needed. Mobile/browser ports compile this API but start() throws UnsupportedOperationException. Support does not imply permission to run every executable. Builders are mutable and are not thread safe.
File redirection and inheritIO are not provided in this initial subset. Use the streams and drain stdout/stderr concurrently, or merge them first.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncommand()Returns the live command list, as in JavaSE.Keeps the supplied list, as in JavaSE.Null inherits the parent's working directory.A mutable copy of the inherited environment, initialized on first access.static booleanWhether this port implements subprocess creation (no Display init required).booleanredirectErrorStream(boolean merge) start()Launches a child.
-
Constructor Details
-
ProcessBuilder
-
ProcessBuilder
-
-
Method Details
-
isSupported
public static boolean isSupported()Whether this port implements subprocess creation (no Display init required). -
command
-
command
Keeps the supplied list, as in JavaSE. Validated again at start(). -
command
-
directory
Null inherits the parent's working directory. Paths are native OS paths. -
directory
-
environment
-
redirectErrorStream
-
redirectErrorStream
public boolean redirectErrorStream() -
start
Launches a child. Invalid arguments throw IllegalArgumentException (or NullPointerException); launch/permission errors throw IOException or SecurityException. An unsupported port throws UnsupportedOperationException.- Throws:
IOException
-