in src/main/java/org/apache/log4j/lf5/util/LogFileParser.java [104:156]
public void run() {
int index = 0;
int counter = 0;
LogRecord temp;
boolean isLogFile = false;
_loadDialog = new LogFactor5LoadingDialog(
_monitor.getBaseFrame(), "Loading file...");
try {
String logRecords = loadLogFile(_in);
while ((counter = logRecords.indexOf(RECORD_DELIMITER, index)) != -1) {
temp = createLogRecord(logRecords.substring(index, counter));
isLogFile = true;
if (temp != null) {
_monitor.addMessage(temp);
}
index = counter + RECORD_DELIMITER.length();
}
if (index < logRecords.length() && isLogFile) {
temp = createLogRecord(logRecords.substring(index));
if (temp != null) {
_monitor.addMessage(temp);
}
}
if (isLogFile == false) {
throw new RuntimeException("Invalid log file format");
}
SwingUtilities.invokeLater(new Runnable() {
public void run() {
destroyDialog();
}
});
} catch (RuntimeException e) {
destroyDialog();
displayError("Error - Invalid log file format.\nPlease see documentation"
+ " on how to load log files.");
} catch (IOException e) {
destroyDialog();
displayError("Error - Unable to load log file!");
}
_in = null;
}