throw new AgentException(
"!currentJob.userid == null || currentJob.task == null: doGrade");
// store grader-generated files to the server
// save csv and log as file
TempFile tmpfilelog = TempFile.createFromByteArray(currentJob.log);
saveGradeResultFile(currentJob.getContestId(),
currentJob.getUserid(),
currentJob.getTask(),
tmpfilelog,
currentJob.getTask() + "." + currentJob.getType() + ".grader.log");
TempFile tmpfilecsv = TempFile.createFromByteArray(currentJob.getGradeResult().toString()
.getBytes("UTF-8"));
saveGradeResultFile(currentJob.getContestId(),
currentJob.getUserid(),
currentJob.getTask(),
tmpfilecsv,
currentJob.getTask() + "." + currentJob.getType() + ".grader.csv");
// retreive filelist and recv files
byte[] abyFilelist = recvBytes();
String strFilelist = new String(abyFilelist);
StringTokenizer tFile = new StringTokenizer(strFilelist, "\n");
try {
String strFilename = null;
while (tFile.hasMoreTokens() && !(strFilename = tFile.nextToken().trim()).equals("")) {
TempFile tmpFile = recvFile();
saveGradeResultFile(currentJob.getContestId(), currentJob.getUserid(), currentJob
.getTask(), tmpFile, strFilename);
}
} catch (NoSuchElementException e) {
throw new AgentException("!NoSuchElementException: doGrade");