mirror of
https://github.com/xpipe-io/xpipe.git
synced 2026-10-05 06:37:47 +00:00
Add optional string command execution
This commit is contained in:
1 parent
7bf4b6f4db
commit
dba1feb81f
1 file changed
+3
@@ -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