startAndWaitForConsoleMessageMaxMs

public boolean startAndWaitForConsoleMessageMaxMs(String messageInConsole, long maxWaitUntilReturning)

Starts the Process and waits (blocks) until the process prints a certain message.

You should be sure that the process either prints this message at some point, or otherwise exits on its own. This method will otherwise be slow, but never block forever, as it will "give up" and always return after max. maxWaitUntilReturning ms.

Parameters

messageInConsole

text to wait for in the STDOUT/STDERR of the external process

maxWaitUntilReturning

maximum time to wait, in milliseconds, until returning, if message wasn't seen returning due to max. wait timeout

Throws

for problems such as if the process already exited (without the message ever appearing in the Console)

if interrupted while waiting