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
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetHost()intgetPort()protected abstract Stringprotected com.jcraft.jsch.SessiongetSession(String pathOrUri) get a new session using the default attributes if the given String is a full uri, use the data from the uri insteadgetUser()booleanprotected voidreleaseSession(com.jcraft.jsch.Session session, String pathOrUri) closes the session and remove it from the cache (eg.voidsetAllowedAgentUse(boolean allowedAgentUse) voidvoidsetKeyFile(File filePath) Sets the full file path to use for accessing a PEM key filevoidsetKeyFilePassword(String keyFilePassword) voidsetPassFile(File passFile) voidsetPort(int port) voidsetSshConfig(String sshConfig) voidset the default user to use for the connection if no user is given or a PEM file is usedvoidsetUserPassword(String password) Methods inherited from class AbstractRepository
addTransferListener, fireTransferCompleted, fireTransferCompleted, fireTransferError, fireTransferError, fireTransferEvent, fireTransferInitiated, fireTransferProgress, fireTransferStarted, fireTransferStarted, getFileSeparator, getName, getTimeoutConstraint, hasTransferListener, put, put, removeTransferListener, setName, standardize, toStringMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface Repository
get, getResource, list
-
Constructor Details
-
AbstractSshBasedRepository
public AbstractSshBasedRepository() -
AbstractSshBasedRepository
-
-
Method Details
-
getSession
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
closes the session and remove it from the cache (eg. on case of errors)- Parameters:
session- key for the cachepathOrUri- to release
-
setUser
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
- Returns:
- the user to use for the connection if no user is given or a PEM file is used
-
setKeyFile
Sets the full file path to use for accessing a PEM key file- Parameters:
filePath- fully qualified name
-
getKeyFile
- Returns:
- the keyFile
-
setUserPassword
- Parameters:
password- password to use for user/password authentication
-
getKeyFilePassword
- Returns:
- the keyFile password for public key based authentication
-
setKeyFilePassword
- Parameters:
keyFilePassword- sets password for public key based authentication
-
getUserPassword
- Returns:
- the user password
-
getHost
- Returns:
- the host
-
setHost
- 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
- Parameters:
passFile- the passfile to set
-
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
- Returns:
- sshConfig Path to a local ssh config file
-
setSshConfig
- Parameters:
sshConfig- Path to a local ssh config file
-
getRepositoryScheme
-