Bonjour,
J'ai un problème sur une tache ou je suis rester bloquer sa fait plus qu'une semaine.enfaite j'imprime la base de donnée de mon routeur et je veux les stocker dans un fichier json sous cette forme :
fichier json:
var links = :[{source: "10.194.77.251",target: "10.194.77.254"},{source: "@IP",target: "@IP"},{source: "@IP",target: "@IP"}];

et voila le code de l'impression
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
public String printDB() {
 
		String str = "\n\t\t_____________ " + arrayNode.size() + " NODES _____________\n";
		try {
			for (Entry<Integer, Node> entry : arrayNode.entrySet())
				str += (entry.getValue().toString());
			str += ("\n\t\t_____________ " + arrayLink.size() + " LINKS _____________\n");
 
			for (Link l : arrayLink)
				str += (l.toString());
			str += ("\n\t\t_____________   Stub Networks   _____________\n");
 
			for (int i = 1; i <= 32; i++) {
				if (subnets.get(i) != null)
					for (int inte : subnets.get(i).keySet()) {
						str += ("  subnets " + IP.IntToStringIP(inte) + "/" + i + " : " + IP.IntToStringIP(subnets.get(i).get(inte).rid)) + "\n";
					}
			}
		}