Class SshTransport

  • Direct Known Subclasses:
    TransportGitSsh, TransportSftp

    public abstract class SshTransport
    extends TcpTransport
    The base class for transports that use SSH protocol. This class allows customizing SSH connection settings.
    • Constructor Detail

      • SshTransport

        protected SshTransport​(URIish uri)
        Create a new transport instance without a local repository.
        Parameters:
        uri - the URI used to access the remote repository. This must be the URI passed to Transport.open(URIish).
        Since:
        3.5
    • Method Detail

      • setSshSessionFactory

        public void setSshSessionFactory​(SshSessionFactory factory)
        Set SSH session factory instead of the default one for this instance of the transport.
        Parameters:
        factory - a factory to set, must not be null
        Throws:
        java.lang.IllegalStateException - if session has been already created.
      • getSshSessionFactory

        public SshSessionFactory getSshSessionFactory()
        Returns:
        the SSH session factory that will be used for creating SSH sessions
      • close

        public void close()
        Description copied from class: Transport
        Close any resources used by this transport.

        If the remote repository is contacted by a network socket this method must close that network socket, disconnecting the two peers. If the remote repository is actually local (same system) this method must close any open file handles used to read the "remote" repository.

        Specified by:
        close in class Transport