public static interface ProcessExecutor.ConsoleOutput
Modifier and Type | Interface and Description |
---|---|
static interface |
ProcessExecutor.ConsoleOutput.Listener
A listener that is invoked whenever a line is read from the console.
|
Modifier and Type | Method and Description |
---|---|
void |
clear()
Clears the buffer of lines.
|
Scanner |
filteredAndSplitBy(String regexp,
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.
|
ProcessExecutor.ConsoleOutput.Listener |
getListener()
Returns the set listener
|
boolean |
latestLineMatches(String regexp)
Returns
true if the latest received line matches the given regular expression. |
void |
setListener(ProcessExecutor.ConsoleOutput.Listener listener)
Sets a listener.
|
ProcessExecutor.ConsoleOutput |
waitFor(String regexp)
Waits for a line matching the given regular expression to appear.
|
boolean latestLineMatches(@Nonnull String regexp)
true
if the latest received line matches the given regular expression.regexp
- the regular expressiontrue
in case of match@Nonnull List<String> filteredBy(@Nonnull String regexp)
regexp
- the regular expression@Nonnull Scanner filteredAndSplitBy(@Nonnull String regexp, @Nonnull String delimiterRegexp)
Scanner
over the latest line matching a given regular expression, with the specific
delimiter regular expression.regexp
- the regular expression for the filterdelimiterRegexp
- the regular expression for the Scanner
@Nonnull ProcessExecutor.ConsoleOutput waitFor(@Nonnull String regexp) throws InterruptedException, IOException
regexp
- the regular expressionInterruptedException
- if the wait has been interruptedIOException
- in case the process has terminated or another I/O errorvoid clear()
void setListener(@Nonnull ProcessExecutor.ConsoleOutput.Listener listener)
listener
- the listenerProcessExecutor.ConsoleOutput.Listener
@CheckForNull ProcessExecutor.ConsoleOutput.Listener getListener()
ProcessExecutor.ConsoleOutput.Listener
Copyright © 2009–2015 Tidalwave s.a.s. (http://tidalwave.it). All rights reserved.