Skip to content

Package: SshAuthenticationWithKeyAndPassphrase

SshAuthenticationWithKeyAndPassphrase

nameinstructionbranchcomplexitylinemethod
SshAuthenticationWithKeyAndPassphrase(String, String, int, String, String)
M: 18 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 7 C: 0
0%
M: 1 C: 0
0%
startSshRemoteUpdate(File[])
M: 18 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 3 C: 0
0%
M: 1 C: 0
0%

Coverage

1: package update.remote.ssh.authentication;
2:
3: import java.io.File;
4:
5: import update.remote.exceptions.RemoteUpdateException;
6: import update.remote.ssh.SshRemoteUpdate;
7:
8: /**
9: *
10: * @author Muri
11: *
12: */
13: public class SshAuthenticationWithKeyAndPassphrase implements AbstractSshAuthentication {
14:
15:         /**
16:          * username.
17:          */
18:         private final transient String user;
19:         /**
20:          * The routers IP.
21:          */
22:         private final transient String host;
23:         /**
24:          * This attribute represents the port for the connection.
25:          */
26:         private final transient int port;
27:         /**
28:          * path to keyfile.
29:          */
30:         private final transient String keyPath;
31:         /**
32:          * passphrase for the key.
33:          */
34:         private final transient String passphrase;
35:
36:         /**
37:          *
38:          * @param user
39:          * user
40:          * @param host
41:          * host
42:          * @param port
43:          * port
44:          * @param keyPath
45:          * keyPath
46:          * @param passphrase
47:          * passphrase
48:          */
49:         public SshAuthenticationWithKeyAndPassphrase(final String user, final String host,
50:                         final int port, final String keyPath, final String passphrase) {
51:                 this.user = user;
52:                 this.host = host;
53:                 this.port = port;
54:                 this.keyPath = keyPath;
55:                 this.passphrase = passphrase;
56:         }
57:
58:         @Override
59:         public void startSshRemoteUpdate(final File[] files) throws RemoteUpdateException {
60:                 final SshRemoteUpdate sru = new SshRemoteUpdate(files);
61:                 sru.remoteUpdate(this.user, this.host, this.port, this.keyPath, this.passphrase);
62:         }
63:
64: }