Examples of TempFile


Examples of io.fathom.cloud.blobs.TempFile

            // We can unfreeze the VM now
            freezer.setFrozen(false);

            // TODO: Support side-load

            TempFile snapshotFile = snapshot.copyToFile();
            return snapshotFile;
        } finally {
            if (freezer.isFrozen()) {
                freezer.setFrozen(false);
            }
View Full Code Here

Examples of io.fathom.cloud.blobs.TempFile

    @Override
    public void enqueue(byte[] data) throws IOException {
        String name = System.currentTimeMillis() + "_" + UUID.randomUUID().toString();

        try (TempFile tempFile = new TempFile(new File(tmpDir, name))) {
            Files.write(data, tempFile.getFile());

            tempFile.renameTo(new File(queueDir, name));
        }
    }
View Full Code Here

Examples of io.fathom.cloud.blobs.TempFile

            try (InputStream is = response.getInputStream()) {
                if (is == null) {
                    return null;
                }

                TempFile tempFile = TempFile.create();
                try {
                    try (FileOutputStream os = new FileOutputStream(tempFile.getFile())) {
                        ByteStreams.copy(is, os);
                    }

                    TempFile ret = tempFile;
                    tempFile = null;
                    return ret;
                } finally {
                    if (tempFile != null) {
                        tempFile.close();
View Full Code Here

Examples of kr.or.ioi2002.RMIServer.TempFile

        // 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

Examples of kr.or.ioi2002.RMIServer.TempFile

        }

        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

Examples of kr.or.ioi2002.RMIServer.TempFile

            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

Examples of kr.or.ioi2002.RMIServer.TempFile

            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

Examples of kr.or.ioi2002.RMIServer.TempFile

            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

Examples of kr.or.ioi2002.RMIServer.TempFile

            }
        }

        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

Examples of kr.or.ioi2002.RMIServer.TempFile

            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
TOP
Copyright © 2018 www.massapi.com. 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.