private IniList getIniFile(String filename) throws FormatException, IOException { LOGGER.debug("getIniFile procession: {}", filename); RandomAccessInputStream stream = getFile(filename); String data = stream.readString((int) stream.length()); if (!data.startsWith("[")) { data = data.substring(data.indexOf('['), data.length()); } data = DataTools.stripString(data); BufferedReader reader = new BufferedReader(new StringReader(data)); stream.close(); IniList list = parser.parseINI(reader); // most of the values will be wrapped in double quotes for (IniTable table : list) { LOGGER.debug(""); LOGGER.debug("[" + table.get(IniTable.HEADER_KEY) + "]"); String[] keys = table.keySet().toArray(new String[table.size()]); for (String key : keys) { String value = sanitizeValue(table.get(key)); LOGGER.debug(key + " = " + value); table.put(key, value); } } reader.close(); return list; }
private IniList getIniFile(String filename) throws FormatException, IOException { LOGGER.debug("getIniFile procession: {}", filename); RandomAccessInputStream stream = getFile(filename); String data = stream.readString((int) stream.length()); if (!data.startsWith("[")) { data = data.substring(data.indexOf('['), data.length()); } data = DataTools.stripString(data); BufferedReader reader = new BufferedReader(new StringReader(data)); stream.close(); IniList list = parser.parseINI(reader); // most of the values will be wrapped in double quotes for (IniTable table : list) { LOGGER.debug(""); LOGGER.debug("[" + table.get(IniTable.HEADER_KEY) + "]"); String[] keys = table.keySet().toArray(new String[table.size()]); for (String key : keys) { String value = sanitizeValue(table.get(key)); LOGGER.debug(key + " = " + value); table.put(key, value); } } reader.close(); return list; }