1 |
package net.oni2.aeinstaller; |
2 |
|
3 |
import java.util.HashMap; |
4 |
import java.util.HashSet; |
5 |
|
6 |
import net.oni2.aeinstaller.backend.depot.DepotConfig; |
7 |
import net.oni2.aeinstaller.backend.depot.DepotManager; |
8 |
import net.oni2.aeinstaller.backend.depot.model.Node; |
9 |
import net.oni2.aeinstaller.backend.depot.model.NodeMod; |
10 |
|
11 |
/** |
12 |
* @author Christian Illy |
13 |
*/ |
14 |
public class DepotPackageCheck { |
15 |
|
16 |
/** |
17 |
* @param args |
18 |
* Arguments |
19 |
*/ |
20 |
public static void main(String[] args) { |
21 |
System.out.println("Reading Depot data:"); |
22 |
DepotManager.getInstance().updateInformation(false); |
23 |
System.out.println("\nReading done"); |
24 |
System.out.println(); |
25 |
DepotManager.getInstance().printStats(); |
26 |
|
27 |
System.out.println(); |
28 |
|
29 |
printModsWithFilesNot1(); |
30 |
} |
31 |
|
32 |
private static void printModsWithFilesNot1() { |
33 |
System.out.println("Mod-Nodes with files != 1:"); |
34 |
|
35 |
HashMap<String, HashSet<NodeMod>> foundNodes = new HashMap<String, HashSet<NodeMod>>(); |
36 |
for (Node n : DepotManager.getInstance().getNodesByType( |
37 |
DepotConfig.getNodeType_Mod())) { |
38 |
NodeMod nm = (NodeMod) n; |
39 |
if (nm.getUploads().size() != 1) { |
40 |
if (!foundNodes.containsKey(nm.getInstallMethod().getName())) |
41 |
foundNodes.put(nm.getInstallMethod().getName(), |
42 |
new HashSet<NodeMod>()); |
43 |
foundNodes.get(nm.getInstallMethod().getName()).add(nm); |
44 |
} |
45 |
} |
46 |
|
47 |
for (String inst : foundNodes.keySet()) { |
48 |
System.out.format("Inst method '%s':\n", inst); |
49 |
for (NodeMod nm : foundNodes.get(inst)) { |
50 |
System.out |
51 |
.format(" Node %3d, Files %d, Platform %5s, Type %11s, Submitter %10s, Title \"%s\"\n", |
52 |
nm.getNid(), nm.getUploads().size(), nm |
53 |
.getPlatform().toString(), nm |
54 |
.getTypes().toString(), nm.getName(), |
55 |
nm.getTitle()); |
56 |
} |
57 |
System.out.println(); |
58 |
} |
59 |
} |
60 |
|
61 |
} |