Package: SshUpdate
SshUpdate
| name | instruction | branch | complexity | line | method | ||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| SshUpdate(AbstractSshAuthentication) | 
 | 
 | 
 | 
 | 
 | ||||||||||||||||||||
| initiateUpdate(File[]) | 
 | 
 | 
 | 
 | 
 | ||||||||||||||||||||
| remoteUpdateViaSsh(File[]) | 
 | 
 | 
 | 
 | 
 | ||||||||||||||||||||
Coverage
1: /**
2:  * 
3:  */
4: package update.remote.ssh;
5: 
6: import java.io.File;
7: 
8: import update.remote.AbstractUpdate;
9: import update.remote.exceptions.RemoteUpdateException;
10: import update.remote.ssh.authentication.AbstractSshAuthentication;
11: 
12: /**
13:  * @author Muri
14:  * 
15:  */
16: public class SshUpdate extends AbstractUpdate {
17: 
18:         /**
19:          * Authentication.
20:          */
21:         private final transient AbstractSshAuthentication authentication;
22: 
23:         /**
24:          * @param authentication
25:          *            authentication
26:          */
27:         public SshUpdate(final AbstractSshAuthentication authentication) {
28:                 super();
29:                 this.authentication = authentication;
30:         }
31: 
32:         @Override
33:         public void initiateUpdate(final File[] files) throws RemoteUpdateException {
34:                 try {
35:                         remoteUpdateViaSsh(files);
36:                 } catch (final RemoteUpdateException e) {
37:                         throw new RemoteUpdateException("Error in ssh update:" + e.getMessage()); // NOPMD
38:                                                                                                                                                                                 // nevermind
39:                                                                                                                                                                                 // losing
40:                                                                                                                                                                                 // the stack
41:                                                                                                                                                                                 // trace
42:                 }
43: 
44:         }
45: 
46:         /**
47:          * 
48:          * @param files
49:          *            files
50:          * @throws RemoteUpdateException
51:          *             ConnectionFailedException
52:          */
53:         private void remoteUpdateViaSsh(final File[] files) throws RemoteUpdateException {
54:                 this.authentication.startSshRemoteUpdate(files);
55: 
56:         }
57: }