Hi, how I can retrieve information from my Json file to a list. And check the information in the list
Please note that the number of servers may increase
My Json file
{
"servers": {
"server1": {
"name": "Name1",
"allowStart": true,
"realIP": "0.0.0.0"
},
"server2": {
"name": "Name2",
"allowStart": false,
"realIP": "0.0.0.0"
},
"server3": {
"name": "Name3",
"allowStart": true,
"realIP": "0.0.0.0"
}
}
}
i want to get something like this:
String serverip = "0.0.0.0";
/* code for get ListServer.name ListServer.allowStart ListServer.realIP */
if (ListServer.realIP == serverip && ListServer.allowStart == true){
System.out.print(ListServer.name + " allow to start? " + ListServer.allowStart);
}
Ideally it would be good to recover this json file from a site.
Help me please.