class ServerManager {

    public void loadFromConfig (File config) throws IOException {
        //check, if config file exists
        if (!config.exists()) {
            throw new IllegalStateException("server config file doesnt exists: " + config.getAbsolutePath());
        }

        list.clear();

        String content = FileUtils.readFile(config.getAbsolutePath(), StandardCharsets.UTF_8);
        JSONObject json = new JSONObject(content);

        JSONArray servers = json.getJSONArray("servers");

        for (int i = 0; i < servers.length(); i++) {
            JSONObject server = servers.getJSONObject(i);

            String ip = server.getString("ip");
            int port = server.getInt("port");
            String title = server.getString("title");
            String description = server.getString("description");

            //check, if server is online
            boolean online = SocketUtils.checkRemoteTCPPort(ip, port, 500);

            Server obj = new Server(ip, port, title, description, online);
            list.add(obj);
        }
    }

    public  ServerManager();

}