| 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(); |
| 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.getNodeType_Mod())) { |
| 37 |
NodeMod nm = (NodeMod) n; |
| 38 |
if (nm.getUploads().size() != 1) { |
| 39 |
if (!foundNodes.containsKey(nm.getInstallMethod().getName())) |
| 40 |
foundNodes.put(nm.getInstallMethod().getName(), |
| 41 |
new HashSet<NodeMod>()); |
| 42 |
foundNodes.get(nm.getInstallMethod().getName()).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 |
} |