Package org.eclipse.jgit.transport
Class JschSession.JschProcess
- java.lang.Object
-
- java.lang.Process
-
- org.eclipse.jgit.transport.JschSession.JschProcess
-
- Enclosing class:
- JschSession
private class JschSession.JschProcess extends java.lang.ProcessImplementation of Process for running a single command using Jsch.Uses the Jsch session to do actual command execution and manage the execution.
-
-
Field Summary
Fields Modifier and Type Field Description private com.jcraft.jsch.ChannelExecchannelprivate java.io.InputStreamerrStreamprivate java.io.InputStreaminputStreamprivate java.io.OutputStreamoutputStream(package private) inttimeout
-
Constructor Summary
Constructors Constructor Description JschProcess(java.lang.String commandName, java.util.Map<java.lang.String,java.lang.String> environment, int tms)Opens a channel on the session ("sock") for executing the given command, opens streams, and starts command execution.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private voidcloseOutputStream()voiddestroy()intexitValue()java.io.InputStreamgetErrorStream()java.io.InputStreamgetInputStream()java.io.OutputStreamgetOutputStream()private booleanisRunning()private voidsetupStreams()intwaitFor()
-
-
-
Constructor Detail
-
JschProcess
JschProcess(java.lang.String commandName, java.util.Map<java.lang.String,java.lang.String> environment, int tms) throws TransportException, java.io.IOExceptionOpens a channel on the session ("sock") for executing the given command, opens streams, and starts command execution.- Parameters:
commandName- the command to executeenvironment- environment variables to pass ontms- the timeout value, in seconds, for the command.- Throws:
TransportException- on problems opening a channel or connecting to the remote hostjava.io.IOException- on problems opening streams
-
-
Method Detail
-
closeOutputStream
private void closeOutputStream()
-
setupStreams
private void setupStreams() throws java.io.IOException- Throws:
java.io.IOException
-
getInputStream
public java.io.InputStream getInputStream()
- Specified by:
getInputStreamin classjava.lang.Process
-
getOutputStream
public java.io.OutputStream getOutputStream()
- Specified by:
getOutputStreamin classjava.lang.Process
-
getErrorStream
public java.io.InputStream getErrorStream()
- Specified by:
getErrorStreamin classjava.lang.Process
-
exitValue
public int exitValue()
- Specified by:
exitValuein classjava.lang.Process
-
isRunning
private boolean isRunning()
-
destroy
public void destroy()
- Specified by:
destroyin classjava.lang.Process
-
waitFor
public int waitFor() throws java.lang.InterruptedException- Specified by:
waitForin classjava.lang.Process- Throws:
java.lang.InterruptedException
-
-