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));