Package util.io

Examples of util.io.IniFileReader


* @author bodum
*/
public class IniFileReaderTest extends TestCase {
 
  public void testIniReader() throws IOException {
    IniFileReader reader = new IniFileReader(this.getClass().getResourceAsStream("index.theme"));
   
    assertEquals(81, reader.getAllSections().length);
   
    assertNull(reader.getSection("nadaSection"));
   
    assertEquals(5, reader.getSection("scalable/emotes").size());
    assertEquals(3, reader.getSection("96x96/devices").size());
   
    assertEquals("Tango", reader.getSection("Icon Theme").get("_Name"));
    assertEquals("gnome,crystalsvg", reader.getSection("Icon Theme").get("Inherits"));
  }
View Full Code Here


     
      if (!entryExists("index.theme")) {
        return false;
      }

      IniFileReader iniReader = new IniFileReader(getInputStream("index.theme"));

      HashMap<String, String> iconSection = iniReader.getSection("Icon Theme");
     
      mThemeName = iconSection.get("Name");
      mThemeComment = iconSection.get("Comment");

      String[] directories = (iconSection.get("Directories")).split(",");
     
      int len = directories.length;
      for (int i = 0;i<len;i++) {
        HashMap<String, String> dirMap = iniReader.getSection(directories[i]);
       
        String context = dirMap.get("Context");
        String type = dirMap.get("Type");
        int size = parseInt(dirMap.get("Size"));
        int maxsize = parseInt(dirMap.get("MaxSize"));
View Full Code Here

TOP

Related Classes of util.io.IniFileReader

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.