Package jConfigLib.files

Examples of jConfigLib.files.IniFile


    for(String connectionFile : connectionFiles)
    {
      if(entries == null)
        entries = new ArrayList<ConnectionEntry>();
     
      IniFile file = new IniFile(connectionFile);
     
      HashMap<String, String> excludes = file.getSection("excludes");
      List<String> excludeList = null;
     
      if(excludes != null)
      {
        for(String exclude : excludes.values())
        {
          if(excludeList == null)
            excludeList = new ArrayList<String>();
         
          if(excludeList.contains(exclude) == false)
            excludeList.add(exclude);
        }
      }
     
      HashMap<String, String> connections = file.getSection("connections");
          Set<Entry<String, String> > connectionSet = connections.entrySet();
          Iterator<Map.Entry<String, String>> connectionIterator = connectionSet.iterator();
         
          while(connectionIterator.hasNext())
          {
            Map.Entry<String, String> sectionEntry = (Map.Entry<String, String>)connectionIterator.next();
              String source = (String)sectionEntry.getKey();
              String target = (String)sectionEntry.getValue();
             
              String srcValue = file.getValue("sources", source);
             
              if(srcValue == null)
                srcValue = source;
             
              List<String> targetList = ConfigHelper.getListFromLine(target);
             
              for(String t : targetList)
              {
                String targetValue = file.getValue("targets", t);
               
                if(targetValue == null)
                  targetValue = target;
               
                entries.add(new ConnectionEntry(srcValue, targetValue, excludeList));
View Full Code Here


   * Sets the new Connections from Connection File
   * @param file Connection File
   */
  public static void setConnections(String file)
  {   
    IniFile connectionFile = new IniFile(file);
   
    HashMap<String, String> newSources = connectionFile.getSection("sources");
    HashMap<String, String> newTargets = connectionFile.getSection("targets");
    HashMap<String, String> newConnections = connectionFile.getSection("connections");
    HashMap<String, String> newExcludes = connectionFile.getSection("excludes");
   
    HashMap<String, HashMap<String, String> > sections = mainConfig.getSections();
   
    if(newSources == null)
    {
View Full Code Here

TOP

Related Classes of jConfigLib.files.IniFile

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.