Class DocumentWithSha2

java.lang.Object
eu.europa.esig.dss.model.CommonDocument
eu.europa.esig.dss.tsl.sha2.DocumentWithSha2
All Implemented Interfaces:
eu.europa.esig.dss.model.DSSDocument, Serializable

public class DocumentWithSha2 extends eu.europa.esig.dss.model.CommonDocument
This class is used to represent a downloaded eu.europa.esig.dss.model.DSSDocument with its corresponding ".sha2" file
See Also:
  • Field Summary

    Fields inherited from class eu.europa.esig.dss.model.CommonDocument

    digestMap, mimeType, name
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    protected
    DocumentWithSha2(eu.europa.esig.dss.model.DSSDocument document, eu.europa.esig.dss.model.DSSDocument sha2Document)
    Default constructor
  • Method Summary

    Modifier and Type
    Method
    Description
    protected void
    addErrorMessage(String errorMessage)
    This method adds an error message occurred during the .sha2 file validation
    boolean
    equals(Object object)
     
    eu.europa.esig.dss.model.DSSDocument
    Gets the original document
    Returns a list of errors occurred during processing of .sha2 document.
    eu.europa.esig.dss.model.DSSDocument
    Gets the downloaded sha2 document corresponding to the document
    int
     
     

    Methods inherited from class eu.europa.esig.dss.model.CommonDocument

    getDigest, getDigestValue, getMimeType, getName, save, setMimeType, setName, toString, writeTo

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • DocumentWithSha2

      protected DocumentWithSha2(eu.europa.esig.dss.model.DSSDocument document, eu.europa.esig.dss.model.DSSDocument sha2Document)
      Default constructor
      Parameters:
      document - DSSDocument original downloaded document
      sha2Document - DSSDocument corresponding sha2 document, containing digests of the document
  • Method Details

    • getDocument

      public eu.europa.esig.dss.model.DSSDocument getDocument()
      Gets the original document
      Returns:
      DSSDocument
    • getSha2Document

      public eu.europa.esig.dss.model.DSSDocument getSha2Document()
      Gets the downloaded sha2 document corresponding to the document
      Returns:
      DSSDocument
    • addErrorMessage

      protected void addErrorMessage(String errorMessage)
      This method adds an error message occurred during the .sha2 file validation
      Parameters:
      errorMessage - String error
    • getErrors

      public List<String> getErrors()
      Returns a list of errors occurred during processing of .sha2 document. Returns NULL if validation succeeded.
      Returns:
      a list of String errors, if any
    • openStream

      public InputStream openStream()
    • equals

      public boolean equals(Object object)
      Overrides:
      equals in class eu.europa.esig.dss.model.CommonDocument
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class eu.europa.esig.dss.model.CommonDocument