Class EpubModule

java.lang.Object
edu.harvard.hul.ois.jhove.ModuleBase
org.ithaka.portico.jhove.module.EpubModule
All Implemented Interfaces:
Module

public class EpubModule extends ModuleBase
Module for validation and metadata extraction on EPUB files. Validation is performed by EPUBCheck https://github.com/w3c/epubcheck/ This module uses the metadata produced by EPUBCheck to produce a JHOVE report.
Author:
Karen Hanson
  • Field Details

    • NOTWELLFORMED_ERRCODES

      public static final String[] NOTWELLFORMED_ERRCODES
    • _propList

      protected List<Property> _propList
    • _metadata

      protected Property _metadata
  • Constructor Details

    • EpubModule

      public EpubModule()
      Instantiate a EpubModule object using default properties
    • EpubModule

      public EpubModule(String name, String release, int[] date, String[] format, String coverage, String[] mimetype, String wellformedNote, String validityNote, String repinfoNote, String note, String rights, boolean isRandomAccess, Agent moduleAgent)
      Instantiate a EpubModule object using constructor arguments
      Parameters:
      name -
      release -
      date -
      format -
      coverage -
      mimetype -
      wellformedNote -
      validityNote -
      repinfoNote -
      note -
      rights -
      isRandomAccess -
      moduleAgent -
  • Method Details

    • initializeInstance

      protected void initializeInstance(Agent moduleAgent)
      Initialize core properties - module Agent, format specification Document, and format Signature
      Parameters:
      agentName -
      agentType -
      agentAddress -
      agentTelephone -
      agentEmail -
    • setupDataStream

      protected void setupDataStream(InputStream stream, RepInfo info)
      Overrides:
      setupDataStream in class ModuleBase
    • checkSignatures

      public void checkSignatures(File file, InputStream stream, RepInfo info) throws IOException
      Specified by:
      checkSignatures in interface Module
      Overrides:
      checkSignatures in class ModuleBase
      Throws:
      IOException
    • parse

      public int parse(InputStream stream, RepInfo info, int parseIndex) throws IOException
      Parse the content of a purported EPUB file and store the results in RepInfo.
      Specified by:
      parse in interface Module
      Overrides:
      parse in class ModuleBase
      Parameters:
      stream - An InputStream, positioned at its beginning, which is generated from the object to be parsed. If multiple calls to parse are made on the basis of a nonzero value being returned, a new InputStream must be provided each time.
      info - A fresh (on the first call) RepInfo object which will be modified to reflect the results of the parsing If multiple calls to parse are made on the basis of a nonzero value being returned, the same RepInfo object should be passed with each call.
      parseIndex - Must be 0 in first call to parse. If parse returns a nonzero value, it must be called again with parseIndex equal to that return value.
      Returns:
      Throws:
      IOException
    • parse

      public void parse(RandomAccessFile file, RepInfo info) throws IOException
      Specified by:
      parse in interface Module
      Overrides:
      parse in class ModuleBase
      Throws:
      IOException
    • toUtf8

      public static String toUtf8(String inputString)
      Make sure the string contains valid UTF-8 characters
      Parameters:
      inputString -
      Returns:
      escaped String
    • initParse

      protected void initParse()
      Overrides:
      initParse in class ModuleBase