org.apache.tools.ant.taskdefs.optional.sshClass SSHUserInfo
- java.lang.Object
- org.apache.tools.ant.taskdefs.optional.ssh.SSHUserInfo
- All Implemented Interfaces:
- com.jcraft.jsch.UIKeyboardInteractive, com.jcraft.jsch.UserInfo
public class SSHUserInfo extends java.lang.Object implements com.jcraft.jsch.UserInfo, com.jcraft.jsch.UIKeyboardInteractive
Class containing information on an SSH user.
Constructor Summary
Constructors Constructor and Description SSHUserInfo()
Constructor for SSHUserInfo.SSHUserInfo(java.lang.String password, boolean trustAllCertificates)
Constructor for SSHUserInfo.
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description java.lang.String
getKeyfile()
Returns the keyfile.java.lang.String
getName()
Gets the user name.java.lang.String
getPassphrase()
Returns the passphrase.java.lang.String
getPassphrase(java.lang.String message)
Gets the pass phrase of the user.java.lang.String
getPassword()
Gets the user's password.boolean
getTrust()
boolean
prompt(java.lang.String str)
Prompts a string.java.lang.String[]
promptKeyboardInteractive(java.lang.String destination, java.lang.String name, java.lang.String instruction, java.lang.String[] prompt, boolean[] echo)
Implementation of UIKeyboardInteractive#promptKeyboardInteractive.boolean
promptPassphrase(java.lang.String message)
Implement the UserInfo interface.boolean
promptPassword(java.lang.String passwordPrompt)
Implement the UserInfo interface.boolean
promptYesNo(java.lang.String message)
Implement the UserInfo interface.boolean
retry()
Indicates whether a retry was done.void
setKeyfile(java.lang.String keyfile)
Sets the keyfile.void
setName(java.lang.String name)
Sets the name.void
setPassphrase(java.lang.String passphrase)
Sets the passphrase.void
setPassword(java.lang.String password)
Sets the password.void
setTrust(boolean trust)
Sets the trust.void
showMessage(java.lang.String message)
Implement the UserInfo interface (noop).
Constructor Detail
SSHUserInfo
public SSHUserInfo()Constructor for SSHUserInfo.
SSHUserInfo
public SSHUserInfo(java.lang.String password, boolean trustAllCertificates)Constructor for SSHUserInfo.
- Parameters:
password
- the user's passwordtrustAllCertificates
- if true trust hosts whose identity is unknown
Method Detail
getName
public java.lang.String getName()Gets the user name.
- Returns:
- the user name
getPassphrase
public java.lang.String getPassphrase(java.lang.String message)Gets the pass phrase of the user.
- Parameters:
message
- a message- Returns:
- the passphrase
getPassword
public java.lang.String getPassword()Gets the user's password.
- Specified by:
getPassword
in interfacecom.jcraft.jsch.UserInfo
- Returns:
- the user's password
prompt
public boolean prompt(java.lang.String str)Prompts a string.
- Parameters:
str
- the string- Returns:
- whether the string was prompted
retry
public boolean retry()Indicates whether a retry was done.
- Returns:
- whether a retry was done
setName
public void setName(java.lang.String name)Sets the name.
- Parameters:
name
- The name to set
setPassphrase
public void setPassphrase(java.lang.String passphrase)Sets the passphrase.
- Parameters:
passphrase
- The passphrase to set
setPassword
public void setPassword(java.lang.String password)Sets the password.
- Parameters:
password
- The password to set
setTrust
public void setTrust(boolean trust)Sets the trust.
- Parameters:
trust
- whether to trust or not.
getTrust
public boolean getTrust()
- Returns:
- whether to trust or not.
getPassphrase
public java.lang.String getPassphrase()Returns the passphrase.
- Specified by:
getPassphrase
in interfacecom.jcraft.jsch.UserInfo
- Returns:
- String
getKeyfile
public java.lang.String getKeyfile()Returns the keyfile.
- Returns:
- String
setKeyfile
public void setKeyfile(java.lang.String keyfile)Sets the keyfile.
- Parameters:
keyfile
- The keyfile to set
promptPassphrase
public boolean promptPassphrase(java.lang.String message)Implement the UserInfo interface.
- Specified by:
promptPassphrase
in interfacecom.jcraft.jsch.UserInfo
- Parameters:
message
- ignored- Returns:
- true always
promptPassword
public boolean promptPassword(java.lang.String passwordPrompt)Implement the UserInfo interface.
- Specified by:
promptPassword
in interfacecom.jcraft.jsch.UserInfo
- Parameters:
passwordPrompt
- ignored- Returns:
- true the first time this is called, false otherwise
promptYesNo
public boolean promptYesNo(java.lang.String message)Implement the UserInfo interface.
- Specified by:
promptYesNo
in interfacecom.jcraft.jsch.UserInfo
- Parameters:
message
- ignored- Returns:
- the value of trustAllCertificates
showMessage
public void showMessage(java.lang.String message)Implement the UserInfo interface (noop).
- Specified by:
showMessage
in interfacecom.jcraft.jsch.UserInfo
- Parameters:
message
- ignored
promptKeyboardInteractive
public java.lang.String[] promptKeyboardInteractive(java.lang.String destination, java.lang.String name, java.lang.String instruction, java.lang.String[] prompt, boolean[] echo)Implementation of UIKeyboardInteractive#promptKeyboardInteractive.
- Specified by:
promptKeyboardInteractive
in interfacecom.jcraft.jsch.UIKeyboardInteractive
- Parameters:
destination
- not used.name
- not used.instruction
- not used.prompt
- the method checks if this is one in length.echo
- the method checks if the first element is false.- Returns:
- the password in an size one array if there is a password and if the prompt and echo checks pass.