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

com.rationaleemotions.pojo.PasswordlessEnabledUser Maven / Gradle / Ivy

Go to download

A simple way of interacting with a remote host for executing commands, scp (upload and download)

There is a newer version: 1.0.2
Show newest version
package com.rationaleemotions.pojo;

import com.jcraft.jsch.UserInfo;

/**
 * Represents a user for whom it's assumed that passwordless setup has already been completed.
 * Passwordless setup refers to the process wherein a user is allowed login to a remote host via ssh
 * without being prompted for their password.
 * The setup is fairly simple. Please refer here for more details
 * on how to setup passwordless access
 * to a remote host.
 */
public class PasswordlessEnabledUser implements UserInfo {
    private String passphrase;

    public PasswordlessEnabledUser(String passphrase) {
        this.passphrase = passphrase;
    }
    @Override
    public String getPassphrase() {
        return passphrase;
    }

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

    @Override
    public boolean promptPassword(String message) {
        return false;
    }

    @Override
    public boolean promptPassphrase(String message) {
        return passphrase != null;
    }

    @Override
    public boolean promptYesNo(String message) {
        return false;
    }

    @Override
    public void showMessage(String message) {
        //No Op implementation
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy