Package kr.or.ioi2002.RMIClientBean

Examples of kr.or.ioi2002.RMIClientBean.HttpPostFileParser


    private ManagerMediator mediator;

    public GraderManager(int gradingPort, String workingDirectory) {
        super(gradingPort);
        recordManager = new RecordManager();
        gradingQueueManager = new GradingQueue(workingDirectory);
        machineQueueManager = new MachineQueueManager();
        this.fileRoot = new File(workingDirectory, "USERS");
    }
View Full Code Here


        // delete previous
        clearGradeResultFile(currentJob.getContestId(), currentJob.getUserid(), currentJob
                .getTask());

        // save csv and log as file
        TempFile tmpfilelog = TempFile.createFromByteArray(currentJob.log);
        saveGradeResultFile(currentJob.getContestId(),
                currentJob.getUserid(),
                currentJob.getTask(),
                tmpfilelog,
                currentJob.getTask() + ".grader.log");
        TempFile tmpfilecsv = TempFile.createFromByteArray(currentJob.output);
        saveGradeResultFile(currentJob.getContestId(),
                currentJob.getUserid(),
                currentJob.getTask(),
                tmpfilecsv,
                currentJob.getTask() + ".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");
View Full Code Here

        }

        appendIsSolutionAccepted(job, acceptedSolution);

        if (acceptedSolution) {
            TempFile tmpsrc = null;

            Task task = mediator.getContestManager().getTaskByName(job.getContestId(),
                    job.getTask());
            if (task == null || job.getUserid() == null) {
                LogSubmit.log(job.getUserid() + ", Exception - NOT OK");
View Full Code Here

            String sourceFileName, byte[] sourceFileData, String stdinFileName, byte[] stdinFileData) {
        User user = getUser(contest, userId);
        if (user == null)
            return false;

        TempFile tmp = null;
        TempFile tmp2 = null;
        try {
            tmp = TempFile.createFromByteArray(sourceFileData);
            if (stdinFileName != null && stdinFileData != null) {
                tmp2 = TempFile.createFromByteArray(stdinFileData);
            }
View Full Code Here

            String sourceFileName, byte[] sourceFileData, boolean alwaysAccept) {
        User user = getUser(contest, userId);
        if (user == null)
            return false;

        TempFile tmp = null;
        try {
            tmp = TempFile.createFromByteArray(sourceFileData);
        } catch (java.io.IOException e) {
            Syslog.log("ContestManager: submit: " + e.toString());
            return false;
View Full Code Here

            return;
        }

        try {
            if (job != null && job.result != null && job.result.equals("OK")) {
                TempFile tmpsrc = null;
                if (job.src instanceof TempFile) {
                    tmpsrc = (TempFile) job.src;
                } else {
                    throw new java.io.IOException(
                            "!critical: OnMsgGmSubmitDone: job.src not type of TempFile-impossible");
View Full Code Here

            }
        }

        try {
            if (job != null && job.result != null && job.result.equals("OK")) {
                TempFile tmpsrc = null;
                if (job.src instanceof TempFile) {
                    tmpsrc = (TempFile) job.src;
                } else {
                    throw new java.io.IOException(
                            "!critical: OnMsgGmSubmitDone: job.src not type of TempFile-impossible");
View Full Code Here

            String language, String sourceFileName, byte[] sourceFileData, String stdinFileName, byte[] stdinFileData) {
        User user = getUser(contest, userId);
        if (user == null)
            return false;

        TempFile tmp = null;
        TempFile tmp2 = null;
        try {
            tmp = TempFile.createFromByteArray(sourceFileData);
            if (stdinFileName != null && stdinFileData != null) {
                tmp2 = TempFile.createFromByteArray(stdinFileData);
            }
View Full Code Here

            String language, String sourceFileName, byte[] sourceFileData) {
        User user = getUser(contest, userId);
        if (user == null)
            return false;

        TempFile tmp = null;
        try {
            tmp = TempFile.createFromByteArray(sourceFileData);
        } catch (java.io.IOException e) {
            Syslog.log("ContestManager: submit: " + e.toString());
            return false;
View Full Code Here

            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");
View Full Code Here

TOP

Related Classes of kr.or.ioi2002.RMIClientBean.HttpPostFileParser

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.