mirror of
https://github.com/xpipe-io/xpipe.git
synced 2026-08-14 05:21:02 +00:00
Add optional string command execution
This commit is contained in:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user