Package org.ithaka.portico.jhove.module
Class EpubModule
java.lang.Object
edu.harvard.hul.ois.jhove.ModuleBase
org.ithaka.portico.jhove.module.EpubModule
- All Implemented Interfaces:
Module
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 Summary
FieldsFields inherited from class edu.harvard.hul.ois.jhove.ModuleBase
_app, _bigEndian, _checksumFinished, _ckSummer, _countStream, _coverage, _crc32, _cstream, _date, _defaultParams, _dstream, _features, _format, _init, _isRandomAccess, _je, _logger, _md5, _mimeType, _name, _nByte, _note, _param, _release, _repInfoNote, _rights, _sha1, _sha256, _signature, _specification, _validityNote, _vendor, _verbosity, _wellFormedNoteFields inherited from interface edu.harvard.hul.ois.jhove.Module
MAXIMUM_VERBOSITY, MINIMUM_VERBOSITY -
Constructor Summary
ConstructorsConstructorDescriptionInstantiate a EpubModule object using default propertiesEpubModule(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 -
Method Summary
Modifier and TypeMethodDescriptionvoidcheckSignatures(File file, InputStream stream, RepInfo info) protected voidinitializeInstance(Agent moduleAgent) protected voidintparse(InputStream stream, RepInfo info, int parseIndex) Parse the content of a purported EPUB file and store the results in RepInfo.voidparse(RandomAccessFile file, RepInfo info) protected voidsetupDataStream(InputStream stream, RepInfo info) static StringMake sure the string contains valid UTF-8 charactersMethods inherited from class edu.harvard.hul.ois.jhove.ModuleBase
addIntegerProperty, addIntegerProperty, applyDefaultParams, calcRAChecksum, checkSignatures, checksumIfRafNotCopied, getApp, getBase, getBufferedDataStream, getCoverage, getCRC32, getDate, getDefaultParams, getFeatures, getFormat, getMimeType, getName, getNByte, getNote, getRelease, getRepInfoNote, getRights, getSignature, getSpecification, getValidityNote, getVendor, getWellFormedNote, hasFeature, init, initFeatures, initInfo, isBigEndian, isParamInDefaults, isRandomAccess, param, readByteBuf, readDouble, readDouble, readDouble, readFloat, readFloat, readSignedByte, readSignedByte, readSignedByte, readSignedInt, readSignedInt, readSignedInt, readSignedLong, readSignedRational, readSignedRational, readSignedShort, readSignedShort, readSignedShort, readUnsignedByte, readUnsignedByte, readUnsignedByte, readUnsignedInt, readUnsignedInt, readUnsignedInt, readUnsignedRational, readUnsignedRational, readUnsignedRational, readUnsignedShort, readUnsignedShort, readUnsignedShort, resetParams, setApp, setBase, setChecksums, setCRC32, setDefaultParams, setMD5, setNByte, setSHA1, setSHA256, setValidityNote, setVerbosity, show, skipBytes, skipBytes, skipDstreamToEnd, vectorToPropArray
-
Field Details
-
NOTWELLFORMED_ERRCODES
-
_propList
-
_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
- Parameters:
agentName-agentType-agentAddress-agentTelephone-agentEmail-
-
setupDataStream
- Overrides:
setupDataStreamin classModuleBase
-
checkSignatures
- Specified by:
checkSignaturesin interfaceModule- Overrides:
checkSignaturesin classModuleBase- Throws:
IOException
-
parse
Parse the content of a purported EPUB file and store the results in RepInfo.- Specified by:
parsein interfaceModule- Overrides:
parsein classModuleBase- Parameters:
stream- An InputStream, positioned at its beginning, which is generated from the object to be parsed. If multiple calls toparseare 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 toparseare 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 toparse. Ifparsereturns a nonzero value, it must be called again withparseIndexequal to that return value.- Returns:
- Throws:
IOException
-
parse
- Specified by:
parsein interfaceModule- Overrides:
parsein classModuleBase- Throws:
IOException
-
toUtf8
Make sure the string contains valid UTF-8 characters- Parameters:
inputString-- Returns:
- escaped String
-
initParse
protected void initParse()- Overrides:
initParsein classModuleBase
-