Class WarcRecord<T extends WarcContentBlock>

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

public class WarcRecord<T extends WarcContentBlock>
extends java.lang.Object
Basic constituent of a WARC file. Contains all information of a WARC record.
See Also:
https://iipc.github.io/warc-specifications/specifications/warc-format/warc-1.1/#file-and-record-model
  • Constructor Summary

    Constructors 
    Constructor Description
    WarcRecord()  
  • Method Summary

    Modifier and Type Method Description
    T getContentBlock()
    Returns the WARC record's WarcContentBlock.
    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 the type of a WARC record.
    T getWarcContentBlock()
    Deprecated, for removal: This API element is subject to removal in a future version.
    boolean isContinuation()  
    boolean isConversion()  
    boolean isMetadata()  
    boolean isRequest()  
    boolean isResource()  
    boolean isResponse()  
    boolean isRevisit()  
    boolean isWarcinfo()
    Deprecated, for removal: This API element is subject to removal in a future version.
    boolean isWarcInfo()  

    Methods inherited from class java.lang.Object

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

  • Method Details

    • getContentBlock

      public T getContentBlock()
      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 content block of a WARC record
    • getWarcContentBlock

      @Deprecated(since="1.1.0", forRemoval=true) public T getWarcContentBlock()
      Deprecated, for removal: This API element is subject to removal in a future version.
      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 content block of a WARC record
    • getType

      public WarcRecordType getType()
      Returns the type of a WARC record.
      Returns:
      the type of the record
      See Also:
      https://iipc.github.io/warc-specifications/specifications/warc-format/warc-1.1/#warc-type-mandatory
    • 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()
    • isResource

      public boolean isResource()
    • isMetadata

      public boolean isMetadata()
    • isRevisit

      public boolean isRevisit()
    • isConversion

      public boolean isConversion()
    • isContinuation

      public boolean isContinuation()
    • isWarcinfo

      @Deprecated(since="1.1.0", forRemoval=true) public boolean isWarcinfo()
      Deprecated, for removal: This API element is subject to removal in a future version.