Package com.adobe.epubcheck.api

Examples of com.adobe.epubcheck.api.Report


       
    boolean hadError = false;
    for(File epubDir : parent.listFiles(dirFilter)) {
      Archive epub = new Archive(epubDir.getAbsolutePath(), false);
      epub.createArchive();
      Report report = new DefaultReportImpl(epub.getEpubName());
      EpubCheck check = new EpubCheck(epub.getEpubFile(), report);
      if (check.validate()) {
        System.out.println(Messages.NO_ERRORS__OR_WARNINGS);
        String name = epub.getEpubName();
        name = name.replace(".epub", "-"+now+".epub");
View Full Code Here


    int returnValue = 1;
    try
    {
      if (processArguments(args))
      {
        Report report = createReport();
        report.initialize();
        if (listChecks)
        {
          dumpMessageDictionary(report);
          return 0;
        }
        if (useCustomMessageFile)
        {
          report.setCustomMessageFile(customMessageFile.getAbsolutePath());
        }
        returnValue = processFile(report);
        int returnValue2 = report.generate();
        if (returnValue == 0)
        {
          returnValue = returnValue2;
        }
      }
View Full Code Here

  }

  private Report createReport() throws
      IOException
  {
    Report report;
    if (listChecks)
    {
      report = new DefaultReportImpl("none");
    }
    else if (jsonOutput)
    {
      report = new CheckingReport(path, (fileOut==null)?null:fileOut.getPath());
    }
    else if (xmlOutput)
    {
      PrintWriter pw = null;
    if (fileOut == null) {
    pw = new PrintWriter(System.out, true);
    } else {
    pw = new PrintWriter(fileOut, "UTF-8");
    }
      report = new XmlReportImpl(pw, path, EpubCheck.version());
    }
    else if (xmpOutput)
    {
      PrintWriter pw = null;
      if (fileOut == null) {
      pw = new PrintWriter(System.out, true);
      } else {
      pw = new PrintWriter(fileOut, "UTF-8");
      }
      report = new XmpReportImpl(pw, path, EpubCheck.version());
    }
    else
    {
      report = new DefaultReportImpl(path);
    }
    report.setReportingLevel(this.reportingLevel);
    if (useCustomMessageFile)
    {
      report.setOverrideFile(customMessageFile);
    }

    return report;
  }
View Full Code Here

    int returnValue = 1;
    try
    {
      if (processArguments(args))
      {
        Report report = createReport();
        report.initialize();
        if (listChecks)
        {
          dumpMessageDictionary(report);
          return 0;
        }
        if (useCustomMessageFile)
        {
          report.setCustomMessageFile(customMessageFile.getAbsolutePath());
        }
        returnValue = processEpubFile(report);
        int returnValue2 = report.generate();
        if (returnValue == 0)
        {
          returnValue = returnValue2;
        }
      }
View Full Code Here

    catch (IOException e)
    {
      getReport().message(MessageId.PKG_015, new MessageLocation(ocf.getName(), -1, -1), e.getMessage());
    }

    Report r = getReport();

  }
View Full Code Here

    File expectedResults = new File(outputPath + "/InputStream_Expected.txt");
    FileOutputStream outputStream = new FileOutputStream(actualResults);
    PrintWriter out = new PrintWriter(outputStream);

    FileInputStream epubStream = new FileInputStream(epub);
    Report report = new WriterReportImpl(out, "Testing 123");
    EpubCheck check = new EpubCheck(epubStream, report, epub.getPath());
    Assert.assertEquals("The file should have generated errors.", 2, 2 & check.doValidate());
    out.flush();
    outputStream.close();
    out.close();
View Full Code Here

TOP

Related Classes of com.adobe.epubcheck.api.Report

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.