}
if (line.startsWith("##")) {
province = line.substring(2);
if (province.trim().length() == 0) {
throw logError(new StationImporterException("Found empty provice in line " + lineNumber));
}
logger.info("Provinced changed to: " + province);
} else {
if (province == null) {
throw logError(new StationImporterException("Found station outside province in line "
+ lineNumber));
}
String stationName = line.substring(1);
if (stationName.trim().length() == 0) {
throw logError(new StationImporterException("Found empty station name in line "
+ lineNumber));
}
chinaStation = new ChinaStation();
chinaStation.setName(stationName);
chinaStation.setProvince(province);
}
} else {
if (chinaStation == null) {
throw logError(new StationImporterException(
"Found description does not belong to a station in line " + lineNumber));
}
sb.append(line);
}
}