org.apache.ivy.plugins.repository.ssh

Class AbstractSshBasedRepository

public abstract class AbstractSshBasedRepository extends AbstractRepository

Constructor Summary
AbstractSshBasedRepository()
Method Summary
StringgetHost()
FilegetKeyFile()
StringgetKeyFilePassword()
FilegetPassFile()
intgetPort()
protected abstract StringgetRepositoryScheme()
protected 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 instead
StringgetUser()
StringgetUserPassword()
protected voidreleaseSession(Session session, String pathOrUri)
closes the session and remove it from the cache (eg. on case of errors)
voidsetHost(String host)
voidsetKeyFile(File filePath)
Sets the full file path to use for accessing a PEM key file
voidsetKeyFilePassword(String keyFilePassword)
voidsetPassFile(File passFile)
voidsetPort(int port)
voidsetUser(String user)
set the default user to use for the connection if no user is given or a PEM file is used
voidsetUserPassword(String password)

Constructor Detail

AbstractSshBasedRepository

public AbstractSshBasedRepository()

Method Detail

getHost

public String getHost()

Returns: the host

getKeyFile

public File getKeyFile()

Returns: the keyFile

getKeyFilePassword

public String getKeyFilePassword()

Returns: the keyFile password for public key based authentication

getPassFile

public File getPassFile()

Returns: the passFile

getPort

public int getPort()

Returns: the port

getRepositoryScheme

protected abstract String getRepositoryScheme()

getSession

protected 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 instead

Parameters: pathOrUri might be just a path or a full ssh or sftp uri

Returns: matching Session

getUser

public String getUser()

Returns: the user to use for the connection if no user is given or a PEM file is used

getUserPassword

public String getUserPassword()

Returns: the user password

releaseSession

protected void releaseSession(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

setHost

public void setHost(String host)

Parameters: host the host to set

setKeyFile

public void setKeyFile(File filePath)
Sets the full file path to use for accessing a PEM key file

Parameters: filePath fully qualified name

setKeyFilePassword

public void setKeyFilePassword(String keyFilePassword)

Parameters: keyFilePassword sets password for public key based authentication

setPassFile

public void setPassFile(File passFile)

Parameters: passFile the passfile to set

setPort

public void setPort(int port)

Parameters: port the port to set

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

setUserPassword

public void setUserPassword(String password)

Parameters: password password to use for user/password authentication