Package org.zeroturnaround.exec.close
Class StandardProcessCloser
- java.lang.Object
-
- org.zeroturnaround.exec.close.StandardProcessCloser
-
- All Implemented Interfaces:
ProcessCloser
- Direct Known Subclasses:
TimeoutProcessCloser
public class StandardProcessCloser extends java.lang.Object implements ProcessCloser
StopsExecuteStreamHandler
from pumping the streams and closes them.
-
-
Field Summary
Fields Modifier and Type Field Description private static org.slf4j.Logger
log
protected ExecuteStreamHandler
streams
-
Constructor Summary
Constructors Constructor Description StandardProcessCloser(ExecuteStreamHandler streams)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description private static java.io.IOException
add(java.io.IOException exception, java.io.IOException newException)
void
close(java.lang.Process process)
Closes standard streams of a given sub process.private void
closeStreams(java.lang.Process process)
Close the streams belonging to the given Process.
-
-
-
Field Detail
-
log
private static final org.slf4j.Logger log
-
streams
protected final ExecuteStreamHandler streams
-
-
Constructor Detail
-
StandardProcessCloser
public StandardProcessCloser(ExecuteStreamHandler streams)
-
-
Method Detail
-
close
public void close(java.lang.Process process) throws java.io.IOException, java.lang.InterruptedException
Description copied from interface:ProcessCloser
Closes standard streams of a given sub process.- Specified by:
close
in interfaceProcessCloser
- Parameters:
process
- sub process (notnull
).- Throws:
java.io.IOException
- if I/O errors occur while closing the underlying streamjava.lang.InterruptedException
- if underlying throws a InterruptedException
-
closeStreams
private void closeStreams(java.lang.Process process) throws java.io.IOException
Close the streams belonging to the given Process.- Throws:
java.io.IOException
-
add
private static java.io.IOException add(java.io.IOException exception, java.io.IOException newException)
-
-