Class AbstractSshBasedRepository

java.lang.Object
org.apache.ivy.plugins.repository.AbstractRepository
org.apache.ivy.plugins.repository.ssh.AbstractSshBasedRepository
All Implemented Interfaces:
Repository
Direct Known Subclasses:
SFTPRepository, SshRepository

public abstract class AbstractSshBasedRepository extends AbstractRepository
  • Constructor Details

    • AbstractSshBasedRepository

      public AbstractSshBasedRepository()
    • AbstractSshBasedRepository

      public AbstractSshBasedRepository(TimeoutConstraint timeoutConstraint)
  • Method Details

    • getSession

      protected com.jcraft.jsch.Session getSession(String pathOrUri) throws IOException
      get a new session using the default attributes if the given String is a full uri, use the data from the uri instead
      Parameters:
      pathOrUri - might be just a path or a full ssh or sftp uri
      Returns:
      matching Session
      Throws:
      IOException - if something goes wrong
    • releaseSession

      protected void releaseSession(com.jcraft.jsch.Session session, String pathOrUri)
      closes the session and remove it from the cache (eg. on case of errors)
      Parameters:
      session - key for the cache
      pathOrUri - to release
    • setUser

      public void setUser(String user)
      set the default user to use for the connection if no user is given or a PEM file is used
      Parameters:
      user - to use
    • getUser

      public String getUser()
      Returns:
      the user to use for the connection if no user is given or a PEM file is used
    • setKeyFile

      public void setKeyFile(File filePath)
      Sets the full file path to use for accessing a PEM key file
      Parameters:
      filePath - fully qualified name
    • getKeyFile

      public File getKeyFile()
      Returns:
      the keyFile
    • setUserPassword

      public void setUserPassword(String password)
      Parameters:
      password - password to use for user/password authentication
    • getKeyFilePassword

      public String getKeyFilePassword()
      Returns:
      the keyFile password for public key based authentication
    • setKeyFilePassword

      public void setKeyFilePassword(String keyFilePassword)
      Parameters:
      keyFilePassword - sets password for public key based authentication
    • getUserPassword

      public String getUserPassword()
      Returns:
      the user password
    • getHost

      public String getHost()
      Returns:
      the host
    • setHost

      public void setHost(String host)
      Parameters:
      host - the host to set
    • getPort

      public int getPort()
      Returns:
      the port
    • setPort

      public void setPort(int port)
      Parameters:
      port - the port to set
    • setPassFile

      public void setPassFile(File passFile)
      Parameters:
      passFile - the passfile to set
    • getPassFile

      public File getPassFile()
      Returns:
      the passFile
    • isAllowedAgentUse

      public boolean isAllowedAgentUse()
      Returns:
      allowedAgentUse Whether use of a local SSH agent for authentication is allowed
    • setAllowedAgentUse

      public void setAllowedAgentUse(boolean allowedAgentUse)
      Parameters:
      allowedAgentUse - Whether use of a local SSH agent for authentication is allowed
    • getSshConfig

      public String getSshConfig()
      Returns:
      sshConfig Path to a local ssh config file
    • setSshConfig

      public void setSshConfig(String sshConfig)
      Parameters:
      sshConfig - Path to a local ssh config file
    • getRepositoryScheme

      protected abstract String getRepositoryScheme()