|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objecttcl.lang.process.Redirect
public class Redirect
Represents a redirection on one of the streams attached to a TclProcess. Inspired by the Java 1.7 API.
Nested Class Summary | |
---|---|
static class |
Redirect.Type
The types of redirection that can be defined |
Field Summary | |
---|---|
protected boolean |
appendToFile
If true, append to file |
protected Channel |
channel
The Channel object, for TCL_CHANNEL redirects |
protected boolean |
closeChannel
If true, close channel when complete |
protected File |
file
The File object, for FILE redirects |
protected InputStream |
inputStream
An inputStream, for STREAM redirects |
protected OutputStream |
outputStream
And output stream, for STREAM redirects |
protected TclProcess |
pipePartner
The TclProcess on the other side of the pipe, for PIPE redirects |
protected String |
specifiedFilePath
A filename for file directs as specified to Tcl; used for error messages |
protected Redirect.Type |
type
The kind of redirection (see enum Type) |
Constructor Summary | |
---|---|
Redirect(Channel channel,
boolean close)
Create a Tcl Channel redirect |
|
Redirect(File f,
String specifiedPath,
boolean append)
Create a File redirect |
|
Redirect(TclProcess partner)
Create a PIPE redirect |
Method Summary | |
---|---|
InputStream |
getInputStream()
|
OutputStream |
getOutputStream()
|
Redirect.Type |
getType()
|
static Redirect |
inherit()
|
void |
setInputStream(InputStream inputStream)
|
void |
setOutputStream(OutputStream outputStream)
|
static Redirect |
stderrToStdout()
|
static Redirect |
stream()
Create an STREAM redirect |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected Redirect.Type type
protected Channel channel
protected File file
protected String specifiedFilePath
protected TclProcess pipePartner
protected boolean closeChannel
protected boolean appendToFile
protected InputStream inputStream
protected OutputStream outputStream
Constructor Detail |
---|
public Redirect(TclProcess partner)
partner
- TclProcess on the other side of the pipe. This Redirect object
is attached to the TclProcess on this side of the pipe.public Redirect(File f, String specifiedPath, boolean append)
f
- File to redirect bytes from/tospecifiedPath
- File name as specified to Tcl; used for error messagespublic Redirect(Channel channel, boolean close)
channel
- to redirect bytes from/toclose
- if true, close channel on process exitMethod Detail |
---|
public static Redirect stream()
public static Redirect inherit()
public static Redirect stderrToStdout()
public Redirect.Type getType()
public InputStream getInputStream()
public void setInputStream(InputStream inputStream)
inputStream
- the inputStream to set for STREAM redirects. Must be set by TclProcess subclass.public OutputStream getOutputStream()
public void setOutputStream(OutputStream outputStream)
outputStream
- the outputStream to set for STREAM redirects. Must be set by TclProcess subclass.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |