diff --git a/src/main/java/org/jenkinsci/plugins/cppcheck/parser/CppcheckParser.java b/src/main/java/org/jenkinsci/plugins/cppcheck/parser/CppcheckParser.java index 6b7197b..27f8f6a 100644 --- a/src/main/java/org/jenkinsci/plugins/cppcheck/parser/CppcheckParser.java +++ b/src/main/java/org/jenkinsci/plugins/cppcheck/parser/CppcheckParser.java @@ -11,6 +11,7 @@ import javax.xml.bind.JAXBException; import javax.xml.bind.Unmarshaller; import java.io.File; +import java.io.FileInputStream; import java.io.IOException; import java.io.Serializable; import java.util.ArrayList; @@ -43,7 +44,8 @@ public CppcheckReport parse(final File file, BuildListener listener) throws IOEx org.jenkinsci.plugins.cppcheck.model.Cppcheck.class, org.jenkinsci.plugins.cppcheck.model.Results.class)); Unmarshaller unmarshaller = jc.get().createUnmarshaller(); - org.jenkinsci.plugins.cppcheck.model.Results results = (org.jenkinsci.plugins.cppcheck.model.Results) unmarshaller.unmarshal(file); + FileInputStream stream = new FileInputStream(file); + org.jenkinsci.plugins.cppcheck.model.Results results = (org.jenkinsci.plugins.cppcheck.model.Results) unmarshaller.unmarshal(stream); if (results.getCppcheck() == null) { throw new JAXBException("Test with versio 1"); }