source: AE/installer2/src/net/oni2/aeinstaller/DepotPackageCheck.java@ 670

Last change on this file since 670 was 662, checked in by alloc, 12 years ago

AEI2 0.99m:

  • Made the Depot query even more invulnerable against caches
File size: 1.7 KB
Line 
1package net.oni2.aeinstaller;
2
3import java.util.HashMap;
4import java.util.HashSet;
5
6import net.oni2.aeinstaller.backend.depot.DepotConfig;
7import net.oni2.aeinstaller.backend.depot.DepotManager;
8import net.oni2.aeinstaller.backend.depot.model.Node;
9import net.oni2.aeinstaller.backend.depot.model.NodeMod;
10
11/**
12 * @author Christian Illy
13 */
14public 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();
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}
Note: See TracBrowser for help on using the repository browser.