int status;
int i = 0;
if (answers.size() == 0) {
return;
}
JGDIAnswer answer;
String text;
for (i = 0; i < answers.size() - 1; i++) {
answer = answers.get(i);
status = answer.getQuality();
if (status == 0 || status == 1) { //If critical or error
exitCode = status;
}
text = answer.getText().trim();
//To be compatible the C clients
if (text.startsWith("denied:")) {
text = "error: " + text;
}
if (text.length() > 0 && !text.equals("ok")) {
out.println(text);
}
}
//Get the last
answer = answers.get(i);
status = answer.getQuality();
text = answer.getText().trim();
//To be compatible the C clients
//TODO LP: This is not 100% correct some clients show only denied:
if (status == 0 || status == 1 || exitCode != 0) {
throw new IllegalArgumentException(text);