Package org.apache.sshd.git.pgm
Class EmbeddedCommandRunner
- java.lang.Object
-
- org.apache.sshd.git.pgm.EmbeddedCommandRunner
-
public class EmbeddedCommandRunner extends java.lang.ObjectTODO Add javadoc
-
-
Field Summary
Fields Modifier and Type Field Description private java.util.List<java.lang.String>argumentsprivate java.lang.Stringgitdirprivate booleanhelpprivate java.nio.file.PathrootDirprivate booleanshowStackTraceprivate org.eclipse.jgit.pgm.CommandRefsubcommandprivate booleanuseWhitelistprivate static java.util.Set<java.lang.String>WHITELIST
-
Constructor Summary
Constructors Constructor Description EmbeddedCommandRunner(java.nio.file.Path rootDir)EmbeddedCommandRunner(java.nio.file.Path rootDir, boolean useWhitelist)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private java.lang.Objectcall(java.lang.Object obj, java.lang.String name)private java.lang.Objectcall(java.lang.Object obj, java.lang.String name, java.lang.Class<?>[] types, java.lang.Object[] args)voidexecute(java.lang.String[] argv, java.io.InputStream in, java.io.OutputStream out, java.io.OutputStream err)Execute a command.private java.lang.Objectget(java.lang.Object obj, java.lang.String name)protected org.eclipse.jgit.lib.RepositoryopenGitDir(java.lang.String gitdir)Evaluate the--git-diroption and open the repository.private java.util.List<java.lang.String>removeOutput(java.util.List<java.lang.String> args)private voidset(java.lang.Object obj, java.lang.String name, java.lang.Object val)
-
-
-
Field Detail
-
WHITELIST
private static final java.util.Set<java.lang.String> WHITELIST
-
useWhitelist
private final boolean useWhitelist
-
help
private boolean help
-
showStackTrace
private boolean showStackTrace
-
gitdir
private java.lang.String gitdir
-
subcommand
private org.eclipse.jgit.pgm.CommandRef subcommand
-
arguments
private java.util.List<java.lang.String> arguments
-
rootDir
private java.nio.file.Path rootDir
-
-
Method Detail
-
execute
public void execute(java.lang.String[] argv, java.io.InputStream in, java.io.OutputStream out, java.io.OutputStream err) throws java.lang.ExceptionExecute a command.- Parameters:
argv- the command and its argumentsin- the input stream, may be null in which case the system input stream will be usedout- the output stream, may be null in which case the system output stream will be usederr- the error stream, may be null in which case the system error stream will be used- Throws:
java.lang.Exception- if an error occurs
-
removeOutput
private java.util.List<java.lang.String> removeOutput(java.util.List<java.lang.String> args)
-
get
private java.lang.Object get(java.lang.Object obj, java.lang.String name) throws java.lang.IllegalAccessException, java.lang.NoSuchFieldException- Throws:
java.lang.IllegalAccessExceptionjava.lang.NoSuchFieldException
-
set
private void set(java.lang.Object obj, java.lang.String name, java.lang.Object val) throws java.lang.IllegalAccessException, java.lang.NoSuchFieldException- Throws:
java.lang.IllegalAccessExceptionjava.lang.NoSuchFieldException
-
call
private java.lang.Object call(java.lang.Object obj, java.lang.String name) throws java.lang.NoSuchMethodException, java.lang.reflect.InvocationTargetException, java.lang.IllegalAccessException- Throws:
java.lang.NoSuchMethodExceptionjava.lang.reflect.InvocationTargetExceptionjava.lang.IllegalAccessException
-
call
private java.lang.Object call(java.lang.Object obj, java.lang.String name, java.lang.Class<?>[] types, java.lang.Object[] args) throws java.lang.NoSuchMethodException, java.lang.reflect.InvocationTargetException, java.lang.IllegalAccessException- Throws:
java.lang.NoSuchMethodExceptionjava.lang.reflect.InvocationTargetExceptionjava.lang.IllegalAccessException
-
openGitDir
protected org.eclipse.jgit.lib.Repository openGitDir(java.lang.String gitdir) throws java.io.IOExceptionEvaluate the--git-diroption and open the repository.- Parameters:
gitdir- the--git-diroption given on the command line. May be null if it was not supplied.- Returns:
- the repository to operate on.
- Throws:
java.io.IOException- the repository cannot be opened.
-
-