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()
int
getPort()
protected abstract String
protected com.jcraft.jsch.Session
getSession
(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()
boolean
protected void
releaseSession
(com.jcraft.jsch.Session session, String pathOrUri) closes the session and remove it from the cache (eg.void
setAllowedAgentUse
(boolean allowedAgentUse) void
void
setKeyFile
(File filePath) Sets the full file path to use for accessing a PEM key filevoid
setKeyFilePassword
(String keyFilePassword) void
setPassFile
(File passFile) void
setPort
(int port) void
setSshConfig
(String sshConfig) void
set the default user to use for the connection if no user is given or a PEM file is usedvoid
setUserPassword
(String password) Methods inherited from class org.apache.ivy.plugins.repository.AbstractRepository
addTransferListener, fireTransferCompleted, fireTransferCompleted, fireTransferError, fireTransferError, fireTransferEvent, fireTransferInitiated, fireTransferProgress, fireTransferStarted, fireTransferStarted, getFileSeparator, getName, getTimeoutConstraint, hasTransferListener, put, put, removeTransferListener, setName, standardize, toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.apache.ivy.plugins.repository.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
-