- java.lang.Object
-
- com.github.alexdlaird.util.ProcessUtils
-
public class ProcessUtils extends java.lang.ObjectConvenience methods for executing processes and capturing their output.
-
-
Constructor Summary
Constructors Constructor Description ProcessUtils()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static java.lang.StringcaptureRunProcess(java.nio.file.Path ngrokPath, java.util.List<java.lang.String> args)Start a blockingngrokprocess with the binary at the given path and the passed args.
-
-
-
Method Detail
-
captureRunProcess
public static java.lang.String captureRunProcess(java.nio.file.Path ngrokPath, java.util.List<java.lang.String> args) throws java.lang.InterruptedException, java.io.IOExceptionStart a blockingngrokprocess with the binary at the given path and the passed args. When the process returns, so will this method, and the captured output from the process along with it.This method is meant for invoking
ngrokdirectly (for instance, for API requests) and is not necessarily compatible with non-blocking API methods or interacting with active tunnels. For that, useNgrokProcess.- Parameters:
args- The args to pass tongrok.- Returns:
- The output from the process.
- Throws:
NgrokException- Thengrokprocess exited with an error.java.lang.InterruptedException- The thread was interrupted during execution.java.io.IOException- An I/O exception occurred.
-
-