mirror of
https://github.com/xpipe-io/xpipe.git
synced 2024-11-25 00:50:31 +00:00
Add optional string command execution
This commit is contained in:
parent
7bf4b6f4db
commit
dba1feb81f
1 changed files with 3 additions and 0 deletions
|
@ -7,6 +7,7 @@ import java.io.InputStream;
|
|||
import java.io.InputStreamReader;
|
||||
import java.io.OutputStream;
|
||||
import java.nio.charset.Charset;
|
||||
import java.util.Optional;
|
||||
import java.util.function.Consumer;
|
||||
import java.util.function.Function;
|
||||
|
||||
|
@ -90,6 +91,8 @@ public interface CommandControl extends ProcessControl {
|
|||
|
||||
String readStdoutAndWait() throws Exception;
|
||||
|
||||
Optional<String> readStdoutIfPossible() throws Exception;
|
||||
|
||||
default boolean discardAndCheckExit() throws ProcessOutputException {
|
||||
try {
|
||||
discardOrThrow();
|
||||
|
|
Loading…
Reference in a new issue