Skip to content

Package: SshAuthenticationWithKey

SshAuthenticationWithKey

nameinstructionbranchcomplexitylinemethod
SshAuthenticationWithKey(String, String, int, String)
M: 15 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 6 C: 0
0%
M: 1 C: 0
0%
startSshRemoteUpdate(File[])
M: 16 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 SshAuthenticationWithKey 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:         /**
33:          *
34:          * @param user
35:          * user
36:          * @param host
37:          * host
38:          * @param port
39:          * port
40:          * @param keyPath
41:          * keyPath
42:          */
43:         public SshAuthenticationWithKey(final String user, final String host, final int port,
44:                         final String keyPath) {
45:                 this.user = user;
46:                 this.host = host;
47:                 this.port = port;
48:                 this.keyPath = keyPath;
49:         }
50:
51:         @Override
52:         public void startSshRemoteUpdate(final File[] files) throws RemoteUpdateException {
53:                 final SshRemoteUpdate sru = new SshRemoteUpdate(files);
54:                 sru.remoteUpdate(this.user, this.host, this.port, this.keyPath);
55:         }
56:
57: }