sftpverification.java

来自「JAVA FTP客户端经典」· Java 代码 · 共 55 行

JAVA
55
字号
package net.sf.jftp.net;import net.sf.jftp.util.*;import net.sf.jftp.*;import com.sshtools.j2ssh.transport.*;public class SftpVerification extends AbstractHostKeyVerification{    public SftpVerification() throws InvalidHostFileException    {    }    public void onDeniedHost(final String host)                                            throws TransportProtocolException    {             Log.debug( "Access to '" + host + "' is denied.\nVerify the access granted/denied in the allowed hosts file.");    }    public void onHostKeyMismatch(final String host, final String recordedFingerprint,                                  final String actualFingerprint)                                            throws TransportProtocolException    {	try	{                        allowHost(host, actualFingerprint, false);        }        catch(Exception ex)	{	 	Log.debug("Error: " + ex);	}    }    public void onUnknownHost(final String host, final String fingerprint)  throws TransportProtocolException     {	 try	 {                     allowHost(host, fingerprint, false);         }        catch(Exception ex)	{	 	Log.debug("Error: " + ex);	}    }    private void showExceptionMessage(Exception ex)    {    	Log.debug("Error: " + ex);    }}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?