Package com.indeed.proctor.common

Examples of com.indeed.proctor.common.SpecificationResult


            resourceAsStream = getClass().getClassLoader().getResourceAsStream(proctorSpecClassPath);
        } else {
            resourceAsStream = getServletContext().getResourceAsStream(proctorSpecPath);
        }

        final SpecificationResult results = new SpecificationResult();
        try {
            if (resourceAsStream == null) {
                throw new ServletException("No resource stream for proctorSpecPath " + proctorSpecPath);
            }

            final ProctorSpecification specification = OBJECT_MAPPER.readValue(resourceAsStream, ProctorSpecification.class);
            results.setSpecification(specification);
        } catch (final Throwable t) {
            final String message = "Unable to parse specification in " + proctorSpecPath;

            LOGGER.error(message, t);

            final StringWriter sw = new StringWriter();
            final PrintWriter writer = new PrintWriter(sw);
            t.printStackTrace(writer);

            results.setError(message);
            results.setException(sw.toString());
        }

        final PrintWriter writer = resp.getWriter();

        OBJECT_MAPPER.defaultPrettyPrintingWriter().writeValue(writer, results);
View Full Code Here

TOP

Related Classes of com.indeed.proctor.common.SpecificationResult

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.