Class 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 Object
implements com.jcraft.jsch.UserInfo, com.jcraft.jsch.UIKeyboardInteractive
Class containing information on an SSH user.
- 
Constructor SummaryConstructorsConstructorDescriptionConstructor for SSHUserInfo.SSHUserInfo(String password, boolean trustAllCertificates) Constructor for SSHUserInfo.
- 
Method SummaryModifier and TypeMethodDescriptionReturns the keyfile.getName()Gets the user name.Returns the passphrase.getPassphrase(String message) Gets the pass phrase of the user.Gets the user's password.booleangetTrust()booleanPrompts a string.String[]promptKeyboardInteractive(String destination, String name, String instruction, String[] prompt, boolean[] echo) Implementation of UIKeyboardInteractive#promptKeyboardInteractive.booleanpromptPassphrase(String message) Implement the UserInfo interface.booleanpromptPassword(String passwordPrompt) Implement the UserInfo interface.booleanpromptYesNo(String message) Implement the UserInfo interface.booleanretry()Indicates whether a retry was done.voidsetKeyfile(String keyfile) Sets the keyfile.voidSets the name.voidsetPassphrase(String passphrase) Sets the passphrase.voidsetPassword(String password) Sets the password.voidsetTrust(boolean trust) Sets the trust.voidshowMessage(String message) Implement the UserInfo interface (noop).
- 
Constructor Details- 
SSHUserInfopublic SSHUserInfo()Constructor for SSHUserInfo.
- 
SSHUserInfoConstructor for SSHUserInfo.- Parameters:
- password- the user's password
- trustAllCertificates- if true trust hosts whose identity is unknown
 
 
- 
- 
Method Details- 
getName
- 
getPassphrase
- 
getPasswordGets the user's password.- Specified by:
- getPasswordin interface- com.jcraft.jsch.UserInfo
- Returns:
- the user's password
 
- 
promptPrompts a string.- Parameters:
- str- the string
- Returns:
- whether the string was prompted
 
- 
retrypublic boolean retry()Indicates whether a retry was done.- Returns:
- whether a retry was done
 
- 
setName
- 
setPassphraseSets the passphrase.- Parameters:
- passphrase- The passphrase to set
 
- 
setPasswordSets the password.- Parameters:
- password- The password to set
 
- 
setTrustpublic void setTrust(boolean trust) Sets the trust.- Parameters:
- trust- whether to trust or not.
 
- 
getTrustpublic boolean getTrust()- Returns:
- whether to trust or not.
 
- 
getPassphraseReturns the passphrase.- Specified by:
- getPassphrasein interface- com.jcraft.jsch.UserInfo
- Returns:
- String
 
- 
getKeyfile
- 
setKeyfile
- 
promptPassphraseImplement the UserInfo interface.- Specified by:
- promptPassphrasein interface- com.jcraft.jsch.UserInfo
- Parameters:
- message- ignored
- Returns:
- true always
 
- 
promptPasswordImplement the UserInfo interface.- Specified by:
- promptPasswordin interface- com.jcraft.jsch.UserInfo
- Parameters:
- passwordPrompt- ignored
- Returns:
- true the first time this is called, false otherwise
 
- 
promptYesNoImplement the UserInfo interface.- Specified by:
- promptYesNoin interface- com.jcraft.jsch.UserInfo
- Parameters:
- message- ignored
- Returns:
- the value of trustAllCertificates
 
- 
showMessageImplement the UserInfo interface (noop).- Specified by:
- showMessagein interface- com.jcraft.jsch.UserInfo
- Parameters:
- message- ignored
 
- 
promptKeyboardInteractivepublic String[] promptKeyboardInteractive(String destination, String name, String instruction, String[] prompt, boolean[] echo) Implementation of UIKeyboardInteractive#promptKeyboardInteractive.- Specified by:
- promptKeyboardInteractivein interface- com.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.
 
 
-