All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.nerve.tools.ssh.DefaultUserInfo Maven / Gradle / Ivy

Go to download

2016年4月25日17:12:24 封装基于SSH的端口转发、文件上传和下载、执行shell等功能 2016年5月13日11:49:57 打包时exclude log4j.properties

The newest version!
package org.nerve.tools.ssh;

import com.jcraft.jsch.UserInfo;

/**
 * com.zeus.ssh
 * Created by zengxm on 2015/12/9 0009.
 */
public class DefaultUserInfo implements UserInfo{
	public String getPassword(){ return passwd; }

	public DefaultUserInfo(String password)
	{
		this.passwd = password;
	}

	public boolean promptYesNo(String str){
		return true;
	}

	String passwd;

	public String getPassphrase(){ return null; }
	public boolean promptPassphrase(String message){ return true; }
	public boolean promptPassword(String message){
		return true;
	}
	public void showMessage(String message){
		System.out.println(message);
	}

	public String[] promptKeyboardInteractive(String destination,
	                                          String name,
	                                          String instruction,
	                                          String[] prompt,
	                                          boolean[] echo){
		return new String[3];
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy