java.lang.Object
org.eclipse.jgit.util.SshSupport
Extra utilities to support usage of SSH.
- Since:
- 5.0
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic String
runSshCommand
(URIish sshUri, CredentialsProvider provider, FS fs, String command, int timeout) Utility to execute a remote SSH command and read the first line of output.
-
Constructor Details
-
SshSupport
public SshSupport()
-
-
Method Details
-
runSshCommand
public static String runSshCommand(URIish sshUri, @Nullable CredentialsProvider provider, FS fs, String command, int timeout) throws IOException, CommandFailedException Utility to execute a remote SSH command and read the first line of output.- Parameters:
sshUri
- the SSH remote URIprovider
- theCredentialsProvider
ornull
.fs
- theFS
implementation passed toSshSessionFactory
command
- the remote command to execute.timeout
- a timeout in seconds. The timeout may be exceeded in corner cases.- Returns:
- The entire output read from stdout.
- Throws:
IOException
- if an IO error occurredCommandFailedException
- if the ssh command execution failed, error message contains the content of stderr.
-