Class WarcRecord

java.lang.Object
com.github.bottomlessarchive.warc.service.record.domain.WarcRecord

public class WarcRecord
extends java.lang.Object
Basic constituent of a WARC file, consisting of a sequence of WARC records. Class WarcRecord contains all information of a WARC record. WarcRecord consists of
  • Protocol of the WARC record
  • WARC record headers
    • WARC-Type
    • WARC-Record-ID
    • WARC-Date
    • Content-Length
  • WARC record content block
  • Constructor Summary

    Constructors 
    Constructor Description
    WarcRecord()  
  • Method Summary

    Modifier and Type Method Description
    java.lang.String getHeader​(java.lang.String headerName)  
    java.util.Map<java.lang.String,​java.lang.String> getHeaders()  
    java.util.Optional<java.lang.String> getRecordId()
    Returns WARC-Record-ID of a WARC record.
    WarcRecordType getType()
    Returns WARC-Type of a WARC record
    WarcContentBlock getWarcContentBlock()
    Returns the WARC record's WarcContentBlock.
    boolean isRequest()  
    boolean isResponse()  
    boolean isWarcinfo()  

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

  • Method Details

    • getWarcContentBlock

      public WarcContentBlock getWarcContentBlock()
      Returns the WARC record's WarcContentBlock. The returned content block may refer to different classes based on the type of the WARC record.
      Returns:
      the WarcContentBlock object of a WARC record
    • getType

      public WarcRecordType getType()
      Returns WARC-Type of a WARC record
      Returns:
      WARC-Type
    • getRecordId

      public java.util.Optional<java.lang.String> getRecordId()
      Returns WARC-Record-ID of a WARC record. WARC-Record-ID is An identifier assigned to the current record that is globally unique for intended amount of time WARC-Record-ID is a mandatory field of record WARC header
      Returns:
      WARC-Record-ID string if possible. Returns null when WARC headers does not contain WARC-Record-ID field
    • getHeader

      public java.lang.String getHeader​(java.lang.String headerName)
    • getHeaders

      public java.util.Map<java.lang.String,​java.lang.String> getHeaders()
    • isRequest

      public boolean isRequest()
    • isResponse

      public boolean isResponse()
    • isWarcinfo

      public boolean isWarcinfo()