Package edu.harvard.hul.ois.jhove.module
Class GzipModule
- java.lang.Object
-
- edu.harvard.hul.ois.jhove.ModuleBase
-
- edu.harvard.hul.ois.jhove.module.GzipModule
-
- All Implemented Interfaces:
Module
public class GzipModule extends ModuleBase
JHOVE module for identifying, validating and characterizing GZIP files. Ported from the JHOVE2 GZIP module, created by lbihanic, selghissassi, nicl JHOVE2 GZip module. This module parses and validates GZip files in compliance with RFC 1952 (GZIP file format specification version 4.3) and supports multiple member GZIP files.This is a non-recursive validation. It only validates the GZIP file format, not the actual content within the WARC records.
- Author:
- jolf@kb.dk
-
-
Field Summary
-
Fields 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, _wellFormedNote
-
Fields inherited from interface edu.harvard.hul.ois.jhove.Module
MAXIMUM_VERBOSITY, MINIMUM_VERBOSITY
-
-
Constructor Summary
Constructors Constructor Description GzipModule()Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcheckSignatures(File file, InputStream stream, RepInfo info)voidcheckSignatures(File file, RandomAccessFile raf, RepInfo info)intparse(InputStream stream, RepInfo info, int parseIndex)voidparse(RandomAccessFile file, RepInfo info)protected voidparseRecords(org.jwat.gzip.GzipReader reader)Parses GZIP entries.protected voidprocessEntry(org.jwat.gzip.GzipEntry entry)Processes a GZIP entry.voidresetParams()Resets parameter settings.-
Methods inherited from class edu.harvard.hul.ois.jhove.ModuleBase
addIntegerProperty, addIntegerProperty, applyDefaultParams, calcRAChecksum, 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, initParse, 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, setApp, setBase, setChecksums, setCRC32, setDefaultParams, setMD5, setNByte, setSHA1, setSHA256, setupDataStream, setValidityNote, setVerbosity, show, skipBytes, skipBytes, skipDstreamToEnd, vectorToPropArray
-
-
-
-
Method Detail
-
resetParams
public void resetParams()
Resets parameter settings. Returns to a default state without any parameters.- Specified by:
resetParamsin interfaceModule- Overrides:
resetParamsin classModuleBase
-
checkSignatures
public void checkSignatures(File file, InputStream stream, RepInfo info) throws IOException
- Specified by:
checkSignaturesin interfaceModule- Overrides:
checkSignaturesin classModuleBase- Throws:
IOException
-
checkSignatures
public void checkSignatures(File file, RandomAccessFile raf, RepInfo info) throws IOException
- Specified by:
checkSignaturesin interfaceModule- Overrides:
checkSignaturesin classModuleBase- Throws:
IOException
-
parse
public void parse(RandomAccessFile file, RepInfo info)
- Specified by:
parsein interfaceModule- Overrides:
parsein classModuleBase
-
parse
public int parse(InputStream stream, RepInfo info, int parseIndex)
- Specified by:
parsein interfaceModule- Overrides:
parsein classModuleBase
-
parseRecords
protected void parseRecords(org.jwat.gzip.GzipReader reader) throws EOFException, IOException, JhoveExceptionParses GZIP entries. Parsing should be straight forward with all records accessible through the same source.- Parameters:
reader- GZIP reader used to parse records- Throws:
EOFException- if EOF occurs prematurelyIOException- if an IO error occurs while processingJhoveException- if a serious problem needs to be reported
-
processEntry
protected void processEntry(org.jwat.gzip.GzipEntry entry) throws EOFException, IOExceptionProcesses a GZIP entry. Extracts all the properties of the entry into a map, and puts this map on the list.- Parameters:
entry- GZIP entry from GZIP reader- Throws:
EOFException- if EOF occurs prematurelyIOException- if an IO error occurs while processing
-
-