Skip to content

Package: ImondUpdate

ImondUpdate

nameinstructionbranchcomplexitylinemethod
ImondUpdate(String, String, int)
M: 12 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 5 C: 0
0%
M: 1 C: 0
0%
initiateUpdate(File[])
M: 19 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 5 C: 0
0%
M: 1 C: 0
0%
remoteUpdateViaImond(File[])
M: 1 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 1 C: 0
0%
M: 1 C: 0
0%

Coverage

1: /**
2: *
3: */
4: package update.remote.imond;
5:
6: import java.io.File;
7:
8: import update.remote.AbstractUpdate;
9: import update.remote.exceptions.RemoteUpdateException;
10:
11: /**
12: * @author Muri
13: *
14: */
15: // TODO: ACHTUNG, da die Klasse nicht vollständig zu sein scheint, werden die PMD-Warnungen dieser
16: // Klasse vorerst ignoriert,
17: // WICHTIG: Wenn die Klasse fertig ist, bitte die folgenden beiden Zeilen wieder löschen!!!!!
18: // This will suppress all the PMD warnings in this class
19: @SuppressWarnings({ "PMD", "unused" })
20: public class ImondUpdate extends AbstractUpdate {
21:
22:         /**
23:          * This attribute represents the server ip for the connection.
24:          */
25:         private final transient String host;
26:         /**
27:          * This attribute represents the password for the connection.
28:          */
29:         private final transient String password;
30:         /**
31:          * This attribute represents the port for the connection.
32:          */
33:         private final transient int port;
34:
35:         /**
36:          * @param host
37:          * host
38:          * @param password
39:          * password
40:          * @param port
41:          * port
42:          */
43:         public ImondUpdate(final String host, final String password, final int port) {
44:                 super();
45:                 this.host = host;
46:                 this.password = password;
47:                 this.port = port;
48:         }
49:
50:         @Override
51:         public void initiateUpdate(final File[] files) throws RemoteUpdateException {
52:                 try {
53:                         remoteUpdateViaImond(files);
54:                 } catch (final RemoteUpdateException e) {
55:                         throw new RemoteUpdateException("Error in imond update:" + e.getMessage());
56:                 }
57:
58:         }
59:
60:         /**
61:          *
62:          * @param files
63:          * files
64:          * @throws RemoteUpdateException
65:          * RemoteUpdateException
66:          */
67:         public void remoteUpdateViaImond(final File[] files) throws RemoteUpdateException {
68:                 // TODO hier eine Methode aufrufen, die das Imond Update aufbaut.
69:                 // Bitte veranlassen, dass alle Exceptions die entstehen zu RemoteUpdateException umgebaut
70:                 // werden. das geht via try+catch, wo im catch dann
71:                 // "throw new RemoteUpdateException(e.getMessage)" gemacht wird. Ihr könnt euch an der
72:                 // SshRemoteUpdate orientieren.
73:                 // Durch die Dateien lässt sich später iterieren mit:
74:                 //
75:                 // for (File file : this.files) {
76:                 // final String filePath = file.getAbsolutePath();
77:                 // //Lade hier file hoch...
78:                 // }
79:                 //
80:                 // LG Muri
81:         }
82: }