package net.oni2.aeinstaller; import java.util.HashMap; import java.util.HashSet; import net.oni2.aeinstaller.backend.depot.DepotConfig; import net.oni2.aeinstaller.backend.depot.DepotManager; import net.oni2.aeinstaller.backend.depot.model.Node; import net.oni2.aeinstaller.backend.depot.model.NodeMod; /** * @author Christian Illy */ public class DepotPackageCheck { /** * @param args * Arguments */ public static void main(String[] args) { System.out.println("Reading Depot data:"); DepotManager.getInstance().updateInformation(false); System.out.println("\nReading done"); System.out.println(); DepotManager.getInstance().printStats(); System.out.println(); printModsWithFilesNot1(); } private static void printModsWithFilesNot1() { System.out.println("Mod-Nodes with files != 1:"); HashMap> foundNodes = new HashMap>(); for (Node n : DepotManager.getInstance().getNodesByType( DepotConfig.getNodeType_Mod())) { NodeMod nm = (NodeMod) n; if (nm.getUploads().size() != 1) { if (!foundNodes.containsKey(nm.getInstallMethod().getName())) foundNodes.put(nm.getInstallMethod().getName(), new HashSet()); foundNodes.get(nm.getInstallMethod().getName()).add(nm); } } for (String inst : foundNodes.keySet()) { System.out.format("Inst method '%s':\n", inst); for (NodeMod nm : foundNodes.get(inst)) { System.out .format(" Node %3d, Files %d, Platform %5s, Type %10s, Title \"%s\"\n", nm.getNid(), nm.getUploads().size(), nm .getPlatform().toString(), nm .getTypes().toString(), nm.getTitle()); } System.out.println(); } } }