Class 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 blocking ngrok process with the binary at the given path and the passed args.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • ProcessUtils

        public ProcessUtils()
    • 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 blocking ngrok 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, use NgrokProcess.

        Parameters:
        args - The args to pass to ngrok.
        Returns:
        The output from the process.
        Throws:
        java.lang.InterruptedException - The thread was interrupted during execution.
        java.io.IOException - An I/O exception occurred.