Package pl.project13.core
Class NativeGitProvider.JavaProcessRunner
java.lang.Object
pl.project13.core.NativeGitProvider.JavaProcessRunner
- All Implemented Interfaces:
NativeGitProvider.ProcessRunner
- Enclosing class:
- NativeGitProvider
protected static class NativeGitProvider.JavaProcessRunner
extends Object
implements NativeGitProvider.ProcessRunner
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionRun a command and return the entire output as a String - naive, we know.booleanRun a command and return false if it contains at least one output line
-
Constructor Details
-
JavaProcessRunner
protected JavaProcessRunner()
-
-
Method Details
-
run
public String run(File directory, long nativeGitTimeoutInMs, String command) throws IOException, GitCommitIdExecutionException Description copied from interface:NativeGitProvider.ProcessRunnerRun a command and return the entire output as a String - naive, we know.- Specified by:
runin interfaceNativeGitProvider.ProcessRunner- Parameters:
directory- the directory where the command should be executed innativeGitTimeoutInMs- the timeout in milliseconds before the command get's terminatedcommand- the command to execute- Returns:
- the output obtained from stdout by running the command
- Throws:
IOException- if any underlying IOError occurredGitCommitIdExecutionException- the command execution failed
-
runEmpty
public boolean runEmpty(File directory, long nativeGitTimeoutInMs, String command) throws IOException, GitCommitIdExecutionException Description copied from interface:NativeGitProvider.ProcessRunnerRun a command and return false if it contains at least one output line- Specified by:
runEmptyin interfaceNativeGitProvider.ProcessRunner- Parameters:
directory- the directory where the command should be executed innativeGitTimeoutInMs- the timeout in milliseconds before the command get's terminatedcommand- the command to execute- Returns:
- false if the output of the command contains at least one line on stdout, true otherwise
- Throws:
IOException- if any underlying IOError occurredGitCommitIdExecutionException- the command execution failed
-