public class DefaultProcessExecutor.DefaultConsoleOutput extends Object implements ProcessExecutor.ConsoleOutput
ProcessExecutor.ConsoleOutput.Listener
Constructor and Description |
---|
DefaultConsoleOutput() |
Modifier and Type | Method and Description |
---|---|
void |
clear()
Clears the buffer of lines.
|
Scanner |
filteredAndSplitBy(String filterRegexp,
String delimiterRegexp)
Returns a
Scanner over the latest line matching a given regular expression, with the specific
delimiter regular expression. |
List<String> |
filteredBy(String regexp)
Returns a list of lines that match the given regular expression.
|
boolean |
latestLineMatches(String regexp)
Returns
true if the latest received line matches the given regular expression. |
ProcessExecutor.ConsoleOutput |
start()
Should not be used by the programmer.
|
ProcessExecutor.ConsoleOutput |
waitFor(String regexp)
Waits for a line matching the given regular expression to appear.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getListener, setListener
@Nonnull public ProcessExecutor.ConsoleOutput start()
public boolean latestLineMatches(@Nonnull String regexp)
true
if the latest received line matches the given regular expression.latestLineMatches
in interface ProcessExecutor.ConsoleOutput
regexp
- the regular expressiontrue
in case of match@Nonnull public Scanner filteredAndSplitBy(@Nonnull String filterRegexp, @Nonnull String delimiterRegexp)
Scanner
over the latest line matching a given regular expression, with the specific
delimiter regular expression.filteredAndSplitBy
in interface ProcessExecutor.ConsoleOutput
filterRegexp
- the regular expression for the filterdelimiterRegexp
- the regular expression for the Scanner
@Nonnull public List<String> filteredBy(@Nonnull String regexp)
filteredBy
in interface ProcessExecutor.ConsoleOutput
regexp
- the regular expression@Nonnull public ProcessExecutor.ConsoleOutput waitFor(@Nonnull String regexp) throws InterruptedException, IOException
waitFor
in interface ProcessExecutor.ConsoleOutput
regexp
- the regular expressionInterruptedException
- if the wait has been interruptedIOException
- in case the process has terminated or another I/O errorpublic void clear()
clear
in interface ProcessExecutor.ConsoleOutput
Copyright © 2009–2016 Tidalwave s.a.s. (http://tidalwave.it). All rights reserved.