Class SshTransport

    • 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:
        IllegalStateException - if session has been already created.
      • getSshSessionFactory

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

        public void close()

        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.

        AutoClosable.close() declares that it throws Exception. Implementers shouldn't throw checked exceptions. This override narrows the signature to prevent them from doing so.

        Specified by:
        close in interface AutoCloseable
        Specified by:
        close in class Transport