public Configuration(String dataFile, String configFile) throws IOException { this.dataFile = dataFile; this.configFile = configFile; BufferedReader reader = new BufferedReader(new InputStreamReader( new FileInputStream(this.configFile), Constants.ENCODING)); IniParser parser = new IniParser(); parser.setCommentDelimiter(null); ini = parser.parseINI(reader); pruneINI(); }
public void parseConfigFile(String configFile) throws IOException { File file = new File(configFile); if (file.isDirectory()) { return; } String parent = file.getParent(); if (configDir != null) { parent = relocateToRoot(parent); } configFile = file.getAbsolutePath(); String dir = file.getParentFile().getAbsolutePath(); IniParser parser = new IniParser(); parser.setCommentDelimiter(null); FileInputStream stream = new FileInputStream(configFile); IniList iniList = parser.parseINI(new BufferedReader( new InputStreamReader(stream, Constants.ENCODING))); for (IniTable table : iniList) { String id = table.get(IniTable.HEADER_KEY); id = id.substring(0, id.lastIndexOf(" ")); id = new File(parent, id).getAbsolutePath(); DefaultMutableTreeNode node = findNode(id, true, configFile); if (node == null) { LOGGER.warn("config file '{}' has invalid filename '{}'", configFile, id); continue; } } }
parser.setCommentDelimiter(";");
parser.setCommentDelimiter(";");
super.initFile(id); parser.setCommentDelimiter(null);
super.initFile(id); parser.setCommentDelimiter(null);