package com.bcxin.ferry.dtos;

import com.jcraft.jsch.UserInfo;
import org.apache.commons.lang3.StringUtils;

public class MyUserInfo implements UserInfo {

    private String password;

    public MyUserInfo(String password) {
        if (StringUtils.isNotBlank(password)) {
            this.password = password;
        }
    }

    @Override
    public String getPassphrase() {
        return null;
    }

    @Override
    public String getPassword() {
        return password;
    }

    @Override
    public boolean promptPassword(String s) {
        return true;
    }

    @Override
    public boolean promptPassphrase(String s) {
        return false;
    }

    @Override
    public boolean promptYesNo(String s) {
        return true;
    }

    @Override
    public void showMessage(String s) {
        System.out.println(s);
    }
}
