private void processLinkFile(File localFile){
TextDocReader reader=null;
boolean bIsFlatTarget=m_targetTreeComponent.m_flat;
try {
reader=new TextDocReader(localFile, null);
JbNode root=reader.parse_all();
List<JbNode> list=root.getChildren();
Map<String, Integer> lastIntanceNumber_map=new HashMap<String, Integer>();
boolean targetReassigned=false;
for(JbNode line: list){
List<String> lineItems=reader.parser.splitValues(line, true);
if(lineItems!=null && lineItems.size()>=4){
String sourcePath=lineItems.get(0);
if(sourcePath==null||sourcePath=="NULL")sourcePath="";
String sourceTag=lineItems.get(1);
String targetPath=lineItems.get(2);
if(targetPath==null||targetPath=="NULL")targetPath="";
String targetTag=lineItems.get(3);
if(targetTag==null || targetTag.equals("skip"))continue;
Node target=m_targetTreeComponent.findNode("["+targetPath+"]");
if(target==null && bIsFlatTarget){
target=m_targetTreeComponent.m_root.getFirstChild();
}
if(target!=null && target.isMultipleMap()){ // this is the case of multiple mapping folder
if(getLastIntanceNumber(lastIntanceNumber_map, target, targetTag)==null){
Node last_folder=find_last_folder(target);
Integer lastInstanceNumber=getLastIntanceNumber(lastIntanceNumber_map, last_folder, targetTag);
if(lastInstanceNumber==null)lastInstanceNumber=0;
moveInstances(last_folder, targetPath, targetTag, target, lastInstanceNumber);
targetReassigned=true;
}
}
if(target!=null)updateLastIntanceNumber_map(lastIntanceNumber_map, target, targetTag);
if(target!=null && target.isLoopNode()){
JbNode sourceJbNode=m_sourceTreeComponent.findJbNode(sourcePath, sourceTag);
JbNode targetJbNode=m_targetTreeComponent.findJbNode(targetPath, targetTag);
if(targetJbNode!=null){
targetJbNode.m_source=sourceJbNode;
}
}
}