()
| 204 | } |
| 205 | |
| 206 | public int doValidate() |
| 207 | { |
| 208 | if (!epubFile.exists()) |
| 209 | { |
| 210 | report.message(MessageId.PKG_018, EPUBLocation.of(epubFile)); |
| 211 | return 2; |
| 212 | } |
| 213 | |
| 214 | OCFChecker checker = new OCFChecker(new ValidationContextBuilder().url(URLUtils.toURL(epubFile)) |
| 215 | .mimetype(MIMEType.EPUB.toString()) |
| 216 | .resourceProvider(new FileResourceProvider(epubFile)).report(report).profile(profile) |
| 217 | .build()); |
| 218 | checker.check(); |
| 219 | |
| 220 | int returnValue = 0; |
| 221 | if (report.getFatalErrorCount() != 0) returnValue |= 4; |
| 222 | if (report.getErrorCount() != 0) returnValue |= 2; |
| 223 | if (report.getWarningCount() != 0) returnValue |= 1; |
| 224 | return returnValue; |
| 225 | } |
| 226 | |
| 227 | } |
no test coverage detected