Class JSchSshClient

java.lang.Object
io.trino.tempto.internal.ssh.JSchSshClient
All Implemented Interfaces:
SshClient, Closeable, AutoCloseable

public class JSchSshClient extends Object implements SshClient
An SshClient based on JSch library.
  • Constructor Details

    • JSchSshClient

      public JSchSshClient(Supplier<com.jcraft.jsch.Session> sessionSupplier)
  • Method Details

    • execute

      public CliProcess execute(List<String> command)
      Specified by:
      execute in interface SshClient
    • execute

      public CliProcess execute(String command)
      Description copied from interface: SshClient
      Executes command on a remote machine.
      Specified by:
      execute in interface SshClient
      Parameters:
      command - Command to be executed on remote machine.
      Returns:
      CLIProcess
    • upload

      public void upload(Path file, String remotePath)
      Description copied from interface: SshClient
      Uploads file to a remote machine. It works like SCP.
      Specified by:
      upload in interface SshClient
      Parameters:
      file - Local path to file which is to be uploaded
      remotePath - Destination path for file on remote machine.
    • close

      public void close()
      Specified by:
      close in interface AutoCloseable
      Specified by:
      close in interface Closeable