private void analyseIO(Process proc) throws IOException, InterruptedException {
BufferedReader goblinStream = new BufferedReader(new InputStreamReader(proc.getInputStream()));
BufferedReader goblerrStream = new BufferedReader(new InputStreamReader(proc.getErrorStream()));
MessageConsoleStream out = consoleOut();
String line;
while ((line = goblinStream.readLine()) != null) {
if (monitor.isCanceled()) {
throw new InterruptedException();
}
if (line.startsWith("WARNING")) {
String[] parts = line.split(" /-/ ");
IFile file = getFile(parts[1]);
int lnr = Integer.parseInt(parts[2]);
String warn = parts[3];
if (file != null)
addMarker(file,lnr,warn);
} else if (line.startsWith("PROGRESS")){
String[] parts = line.split(" /-/ ");
if ("SUBTASK".equals(parts[1])){
int subtaskWork = Integer.parseInt(parts[3]);
monitor.beginSubtask(parts[2], subtaskWork);
} else if ("WORKED".equals(parts[1])) {
int worked = Integer.parseInt(parts[2]);
monitor.worked(worked);
} else if ("MORE WORK".equals(parts[1])){
int work = Integer.parseInt(parts[2]);
monitor.add_work(work);
}
} else
out.println(line);
}
while ((line = goblerrStream.readLine()) != null)
out.println(line);
}