com.sun.electric.tool.user
Class Exec.OutputStreamChecker
java.lang.Object
java.io.OutputStream
com.sun.electric.tool.user.Exec.OutputStreamChecker
- All Implemented Interfaces:
- java.io.Closeable, java.io.Flushable, java.io.Serializable
- Enclosing class:
- Exec
public static class Exec.OutputStreamChecker
- extends java.io.OutputStream
- implements java.io.Serializable
Check for a string passed to the OutputStream. All chars passed to
this class are also transparently passed to System.out.
This only checks for strings within a single line of text.
The strings are simple strings, not regular expressions.
- See Also:
- Serialized Form
Constructor Summary |
Exec.OutputStreamChecker(java.io.OutputStream ostream,
java.lang.String checkFor)
Checks for string in output stream. |
Exec.OutputStreamChecker(java.io.OutputStream ostream,
java.lang.String checkFor,
boolean regexp,
java.io.File copyToFile)
Checks for string in output stream. |
Methods inherited from class java.io.OutputStream |
flush, write, write |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Exec.OutputStreamChecker
public Exec.OutputStreamChecker(java.io.OutputStream ostream,
java.lang.String checkFor)
- Checks for string in output stream. The string may span multiple lines, or may be contained
within a non-terminated line (such as an input query).
- Parameters:
ostream
- send read data to this output stream (usually System.out)checkFor
- the string to check for
Exec.OutputStreamChecker
public Exec.OutputStreamChecker(java.io.OutputStream ostream,
java.lang.String checkFor,
boolean regexp,
java.io.File copyToFile)
- Checks for string in output stream. String must be contained within one line.
- Parameters:
ostream
- send read data to this output stream (usually System.out)checkFor
- the string to check forregexp
- if true, the string is considered a regular expressioncopyToFile
- if non-null, the output is copied to this file
write
public void write(int b)
throws java.io.IOException
- Specified by:
write
in class java.io.OutputStream
- Throws:
java.io.IOException
addOutputStreamCheckerListener
public void addOutputStreamCheckerListener(Exec.OutputStreamCheckerListener l)
removeOutputStreamCheckerListener
public void removeOutputStreamCheckerListener(Exec.OutputStreamCheckerListener l)
getFound
public boolean getFound()
getFoundLine
public java.lang.String getFoundLine()
close
public void close()
- Specified by:
close
in interface java.io.Closeable
- Overrides:
close
in class java.io.OutputStream
getCopyToFile
public java.io.File getCopyToFile()