- java.lang.Object
-
- com.github.alexdlaird.util.ProcessUtils
-
public class ProcessUtils extends java.lang.Object
Convenience 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.String
captureRunProcess(java.nio.file.Path ngrokPath, java.util.List<java.lang.String> args)
Start a blockingngrok
process 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.IOException
Start a blockingngrok
process 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
ngrok
directly (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:
java.lang.InterruptedException
- The thread was interrupted during execution.java.io.IOException
- An I/O exception occurred.
-
-