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 java.lang.Object implements com.jcraft.jsch.UserInfo, com.jcraft.jsch.UIKeyboardInteractiveClass containing information on an SSH user.
- 
- 
Constructor SummaryConstructors Constructor Description SSHUserInfo()Constructor for SSHUserInfo.SSHUserInfo(java.lang.String password, boolean trustAllCertificates)Constructor for SSHUserInfo.
 - 
Method SummaryModifier and Type Method Description java.lang.StringgetKeyfile()Returns the keyfile.java.lang.StringgetName()Gets the user name.java.lang.StringgetPassphrase()Returns the passphrase.java.lang.StringgetPassphrase(java.lang.String message)Gets the pass phrase of the user.java.lang.StringgetPassword()Gets the user's password.booleangetTrust()booleanprompt(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.booleanpromptPassphrase(java.lang.String message)Implement the UserInfo interface.booleanpromptPassword(java.lang.String passwordPrompt)Implement the UserInfo interface.booleanpromptYesNo(java.lang.String message)Implement the UserInfo interface.booleanretry()Indicates whether a retry was done.voidsetKeyfile(java.lang.String keyfile)Sets the keyfile.voidsetName(java.lang.String name)Sets the name.voidsetPassphrase(java.lang.String passphrase)Sets the passphrase.voidsetPassword(java.lang.String password)Sets the password.voidsetTrust(boolean trust)Sets the trust.voidshowMessage(java.lang.String message)Implement the UserInfo interface (noop).
 
- 
- 
- 
Constructor Detail- 
SSHUserInfopublic SSHUserInfo() Constructor for SSHUserInfo.
 - 
SSHUserInfopublic SSHUserInfo(java.lang.String password, boolean trustAllCertificates)Constructor for SSHUserInfo.- Parameters:
- password- the user's password
- trustAllCertificates- if true trust hosts whose identity is unknown
 
 
- 
 - 
Method Detail- 
getNamepublic java.lang.String getName() Gets the user name.- Returns:
- the user name
 
 - 
getPassphrasepublic java.lang.String getPassphrase(java.lang.String message) Gets the pass phrase of the user.- Parameters:
- message- a message
- Returns:
- the passphrase
 
 - 
getPasswordpublic java.lang.String getPassword() Gets the user's password.- Specified by:
- getPasswordin interface- com.jcraft.jsch.UserInfo
- Returns:
- the user's password
 
 - 
promptpublic boolean prompt(java.lang.String str) Prompts 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
 
 - 
setNamepublic void setName(java.lang.String name) Sets the name.- Parameters:
- name- The name to set
 
 - 
setPassphrasepublic void setPassphrase(java.lang.String passphrase) Sets the passphrase.- Parameters:
- passphrase- The passphrase to set
 
 - 
setPasswordpublic void setPassword(java.lang.String password) Sets 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.
 
 - 
getPassphrasepublic java.lang.String getPassphrase() Returns the passphrase.- Specified by:
- getPassphrasein interface- com.jcraft.jsch.UserInfo
- Returns:
- String
 
 - 
getKeyfilepublic java.lang.String getKeyfile() Returns the keyfile.- Returns:
- String
 
 - 
setKeyfilepublic void setKeyfile(java.lang.String keyfile) Sets the keyfile.- Parameters:
- keyfile- The keyfile to set
 
 - 
promptPassphrasepublic boolean promptPassphrase(java.lang.String message) Implement the UserInfo interface.- Specified by:
- promptPassphrasein interface- com.jcraft.jsch.UserInfo
- Parameters:
- message- ignored
- Returns:
- true always
 
 - 
promptPasswordpublic boolean promptPassword(java.lang.String passwordPrompt) Implement the UserInfo interface.- Specified by:
- promptPasswordin interface- com.jcraft.jsch.UserInfo
- Parameters:
- passwordPrompt- ignored
- Returns:
- true the first time this is called, false otherwise
 
 - 
promptYesNopublic boolean promptYesNo(java.lang.String message) Implement the UserInfo interface.- Specified by:
- promptYesNoin interface- com.jcraft.jsch.UserInfo
- Parameters:
- message- ignored
- Returns:
- the value of trustAllCertificates
 
 - 
showMessagepublic void showMessage(java.lang.String message) Implement the UserInfo interface (noop).- Specified by:
- showMessagein interface- com.jcraft.jsch.UserInfo
- Parameters:
- message- ignored
 
 - 
promptKeyboardInteractivepublic 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:
- 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.
 
 
- 
 
-