Package org.apache.sshd.git.pgm
Class EmbeddedCommandRunner
- java.lang.Object
-
- org.apache.sshd.git.pgm.EmbeddedCommandRunner
-
public class EmbeddedCommandRunner extends java.lang.Object
TODO Add javadoc
-
-
Field Summary
Fields Modifier and Type Field Description private java.util.List<java.lang.String>
arguments
private java.lang.String
gitdir
private boolean
help
private java.nio.file.Path
rootDir
private boolean
showStackTrace
private org.eclipse.jgit.pgm.TextBuiltin
subcommand
-
Constructor Summary
Constructors Constructor Description EmbeddedCommandRunner(java.nio.file.Path rootDir)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private java.lang.Object
call(java.lang.Object obj, java.lang.String name)
private java.lang.Object
call(java.lang.Object obj, java.lang.String name, java.lang.Class<?>[] types, java.lang.Object[] args)
void
execute(java.lang.String[] argv, java.io.InputStream in, java.io.OutputStream out, java.io.OutputStream err)
Execute a command.private java.lang.Object
get(java.lang.Object obj, java.lang.String name)
protected org.eclipse.jgit.lib.Repository
openGitDir(java.lang.String gitdir)
Evaluate the--git-dir
option and open the repository.private void
set(java.lang.Object obj, java.lang.String name, java.lang.Object val)
-
-
-
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.Exception
Execute 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
-
get
private java.lang.Object get(java.lang.Object obj, java.lang.String name) throws java.lang.IllegalAccessException, java.lang.NoSuchFieldException
- Throws:
java.lang.IllegalAccessException
java.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.IllegalAccessException
java.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.NoSuchMethodException
java.lang.reflect.InvocationTargetException
java.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.NoSuchMethodException
java.lang.reflect.InvocationTargetException
java.lang.IllegalAccessException
-
openGitDir
protected org.eclipse.jgit.lib.Repository openGitDir(java.lang.String gitdir) throws java.io.IOException
Evaluate the--git-dir
option and open the repository.- Parameters:
gitdir
- the--git-dir
option 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.
-
-