}
continue;
}
Matcher m = pBoss.matcher(line);
if (m.matches()) {
FtnNdlAddress boss = NodelistScanner.getInstance().isExists(
new FtnAddress(m.group(1)));
if (boss == null) {
addError(linenum, line + " not found in nodelist", errors);
bossnotfound = true;
} else {
if (multi || bosses.isEmpty()) {
if (bosses.contains(boss)) {
addError(linenum, line
+ " already exists in pointlist", errors);
bossnotfound = true;
} else {
bosses.add(boss);
points.clear();
bossnotfound = false;
}
} else {
addError(linenum,
"Not multi pointlist, next boss found", errors);
}
continue;
}
}
m = pPoint.matcher(line);
if (m.matches()) {
if (bosses.isEmpty()) {
addError(linenum,
"Point string present, but no boss present before",
errors);
} else {
Long point = Long.valueOf(m.group(1));
if (points.contains(point)) {
if (bossnotfound) {
addError(
linenum,
"Point for boss, thats not found in nodelist",
errors);
} else {
addError(linenum,
"Point " + point + " already exists for "
+ bosses.get(bosses.size() - 1),
errors);
}
} else {
String flags = m.group(7);
if (flags != null && checkflags(flags, linenum, errors)) {
points.add(point);
_points++;
}
}
}
continue;
}
addError(linenum, "Unknown line: " + line, errors);
}
boolean isReg = false;
boolean isNet = false;
if (multi && bosses.size() > 1) {
// TODO
}
// create netmail :-)
boolean success = (errors.length() == 0);
String subject = (success) ? "Segment checked : OK"
: "Segment checked: Errors";
String text = "File: " + fileName + "\nDate: " + new Date().toString()
+ "\n" + "Lines: " + linenum + "\n" + "Flags: "
+ ((isReg) ? "regional" : (isNet) ? "net" : "local") + "\n"
+ "Boss lines: " + bosses.size() + "\n" + "Point lines: "
+ _points + "\n";
if (!success)
text += errors.toString();
for (FtnNdlAddress boss : bosses) {
FtnTools.writeNetmail(FtnTools.getPrimaryFtnAddress(),
boss.clone(), nameFrom,
boss.getLine().split(",")[4].replace('_', ' '), subject,
text);
}
return success;
}