use of org.evosuite.xsd.Project in project evosuite by EvoSuite.
the class StorageManager method getProject.
private static Project getProject(File current, InputStream stream) {
try {
JAXBContext jaxbContext = JAXBContext.newInstance(Project.class);
SchemaFactory factory = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI);
Schema schema = factory.newSchema(new StreamSource(StorageManager.class.getResourceAsStream("/xsd/ctg_project_report.xsd")));
Unmarshaller jaxbUnmarshaller = jaxbContext.createUnmarshaller();
jaxbUnmarshaller.setSchema(schema);
return (Project) jaxbUnmarshaller.unmarshal(stream);
} catch (Exception e) {
String msg = "Error in reading " + current.getAbsolutePath() + " , " + e;
logger.error(msg, e);
throw new RuntimeException(msg);
}
}
Aggregations