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

Last change on this file since 1134 was 749, checked in by alloc, 12 years ago

AEI2 0.99x:

  • Refactoring
File size: 1.6 KB
Line 
1package net.oni2.aeinstaller;
2
3import java.util.HashMap;
4import java.util.HashSet;
5
6import net.oni2.moddepot.DepotConfig;
7import net.oni2.moddepot.DepotManager;
8import net.oni2.moddepot.model.Node;
9import net.oni2.moddepot.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
26 System.out.println();
27
28 printModsWithFilesNot1();
29 }
30
31 private static void printModsWithFilesNot1() {
32 System.out.println("Mod-Nodes with files != 1:");
33
34 HashMap<String, HashSet<NodeMod>> foundNodes = new HashMap<String, HashSet<NodeMod>>();
35 for (Node n : DepotManager.getInstance().getNodesByType(
36 DepotConfig.nodeType_Package)) {
37 NodeMod nm = (NodeMod) n;
38 if (nm.getUploads().size() != 1) {
39 if (!foundNodes.containsKey(nm.getInstallMethod()))
40 foundNodes.put(nm.getInstallMethod(),
41 new HashSet<NodeMod>());
42 foundNodes.get(nm.getInstallMethod()).add(nm);
43 }
44 }
45
46 for (String inst : foundNodes.keySet()) {
47 System.out.format("Inst method '%s':\n", inst);
48 for (NodeMod nm : foundNodes.get(inst)) {
49 System.out
50 .format(" Node %3d, Files %d, Platform %5s, Type %11s, Submitter %10s, Title \"%s\"\n",
51 nm.getNid(), nm.getUploads().size(), nm
52 .getPlatform().toString(), nm
53 .getTypes().toString(), nm.getName(),
54 nm.getTitle());
55 }
56 System.out.println();
57 }
58 }
59
60}
Note: See TracBrowser for help on using the repository browser.