diff --git a/src/main/java/hudson/plugins/sloccount/model/cloc/ClocReport.java b/src/main/java/hudson/plugins/sloccount/model/cloc/ClocReport.java index 033f7a9..d180c79 100644 --- a/src/main/java/hudson/plugins/sloccount/model/cloc/ClocReport.java +++ b/src/main/java/hudson/plugins/sloccount/model/cloc/ClocReport.java @@ -11,6 +11,7 @@ import javax.xml.bind.annotation.XmlRootElement; import java.io.File; import java.io.Serializable; +import java.net.URL; /** * Cloc report parser and the parsed file. @@ -61,10 +62,13 @@ public ClocFiles getFiles() { * @return the content of the parsed file in form of a report * @throws javax.xml.bind.JAXBException if a XML related error occurs */ - public static ClocReport parse(File file) throws JAXBException { + public static ClocReport parse(File file) throws JAXBException, java.io.IOException { JAXBContext context = JAXBContext.newInstance(ClocReport.class); Unmarshaller unmarshaller = context.createUnmarshaller(); - return (ClocReport) unmarshaller.unmarshal(file); + // Jenkins replaces ASCII symbols like : to Unicode in filenames. + // Using File() here couse converting Unicode symbols back to ASCII. + // Such files could not be found of course. + return (ClocReport) unmarshaller.unmarshal(new java.io.FileInputStream(file)); } /**