Class SystemUtils
java.lang.Object
org.aksw.shellgebra.util.SystemUtils
-
Nested Class Summary
Nested Classes -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic InputStreamexec(ProcessBuilder processBuilder) static InputStreamstatic InputStreamstatic InputStreamexecx(ProcessBuilder processBuilder) static voidfailIfNonZero(int exitValue) static voidfailIfNonZero(Process process) static StringgetCommandOutput(String... command) static intgetGID()static intgetUID()static Processrun(ProcessBuilder processBuilder, Consumer<String> logger) static Processstatic voidrunAndWait(Consumer<String> logger, String... cmd) static intstatic String
-
Constructor Details
-
SystemUtils
public SystemUtils()
-
-
Method Details
-
exec
- Throws:
IOExceptionInterruptedException
-
exec
- Throws:
IOExceptionInterruptedException
-
run
public static Process run(Consumer<String> logger, String... cmd) throws IOException, InterruptedException - Throws:
IOExceptionInterruptedException
-
runCmd
- Throws:
IOExceptionInterruptedException
-
run
public static Process run(ProcessBuilder processBuilder, Consumer<String> logger) throws IOException, InterruptedException - Throws:
IOExceptionInterruptedException
-
runAndWait
- Throws:
IOException
-
failIfNonZero
- Throws:
org.apache.commons.exec.ExecuteException
-
failIfNonZero
public static void failIfNonZero(int exitValue) throws org.apache.commons.exec.ExecuteException - Throws:
org.apache.commons.exec.ExecuteException
-
exec
public static InputStream exec(ProcessBuilder processBuilder) throws IOException, InterruptedException - Throws:
IOExceptionInterruptedException
-
execx
public static InputStream execx(ProcessBuilder processBuilder) throws IOException, InterruptedException - Throws:
IOExceptionInterruptedException
-
getCommandOutput
- Throws:
IOException
-
which
- Throws:
IOException
-
getUID
- Throws:
IOException
-
getGID
- Throws:
IOException
-