/** * Este metodo se encarga de cargar el archivo de configuracion * * @throws ConfigFileNotLoadException */ public static void loadConfigFile(String emakuConfigFile) throws ConfigFileNotLoadException { try { builder = new SAXBuilder(false); System.out.println("INFO: Config -> " + emakuConfigFile); File file = new File(emakuConfigFile); doc = builder.build(file); root = doc.getRootElement(); java.util.List Lconfig = root.getChildren(); Iterator i = Lconfig.iterator(); /** * Ciclo encargado de leer las primeras etiquetas del archivo XML, en este caso ConfiguraciĆ³n */ while (i.hasNext()) { Element records = (Element) i.next(); if (records.getName().equals("PoolConnection")) { loadConnectionsPool(records.getChildren()); } else if (records.getName().equals("Lenguaje")) { local = records.getValue(); appLang.loadLanguage(local); } else if (records.getName().equals("Log")) { new LogAdmin(records.getValue(), ServerConstants.KeyServer); } else if (records.getName().equals("SocketJClient")) { clientSocket = Integer.parseInt(records.getValue()); } else if (records.getName().equals("SocketJAdmin")) { adminSocket = Integer.parseInt(records.getValue()); } else if (records.getName().equals("MaxClients")) { MaxClients = Integer.parseInt(records.getValue()); } } LogAdmin.setMessage(Language.getWord("LOADING_CF"), ServerConstants.MESSAGE); } catch (FileNotFoundException FNFEe) { throw new ConfigFileNotLoadException(); } catch (JDOMException JDOMEe) { throw new ConfigFileNotLoadException(); } catch (IOException IOEe) { throw new ConfigFileNotLoadException(); } }