public final class SSHD extends Object implements Closeable
It is a convenient class for unit testing of your SSH clients:
try (SSHD sshd = new SSHD()) { String uptime = new Shell.Plain( SSH(sshd.host(), sshd.login(), sshd.port(), sshd.key()) ).exec("uptime"); }
If you forget to call close()
, SSH daemon will be
up and running until a shutdown of the JVM.
public SSHD() throws IOException
IOException
- If failspublic SSHD(File path) throws IOException
path
- Directory to work inIOException
- If failspublic void close()
close
in interface Closeable
close
in interface AutoCloseable
public File home()
public String login()
public String host()
public int port()
Don't forget to start
public String key() throws IOException
IOException
- If failspublic Shell connect() throws IOException
IOException
- If failsCopyright © 2012–2015 jcabi.com. All rights reserved.