Package bg.smoc.model.serializer

Examples of bg.smoc.model.serializer.FileInfo


            type = Task.TestType.valueOf(testType);
        } catch (IllegalArgumentException e) {
            response.sendRedirect("");
            return;
        }
        FileInfo fileInfo = contestManager.getTestDataFile(contestId,
                task.getName(),
                testNumber,
                type);
        if (fileInfo == null || fileInfo.getSize() > Integer.MAX_VALUE) {
            response.sendRedirect("");
            return;
        }

        response.setContentType("plain/text");
        response.setContentLength((int) fileInfo.getSize());
        response.setHeader("Content-Disposition", "attachment; filename=\""
                + new File(fileInfo.getAbsolutePath()).getName()
                + "\"");
       
        FileUtils.copyStreams(fileInfo.getInputStream(), response.getOutputStream());
        fileInfo.getInputStream().close();
    }
View Full Code Here

TOP

Related Classes of bg.smoc.model.serializer.FileInfo

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.