Class PadesContainer

java.lang.Object
eu.europa.esig.dss.pdf.AbstractPdfObjFactory
eu.europa.esig.dss.pdf.pdfbox.PdfBoxDefaultObjectFactory
org.digidoc4j.impl.pades.PadesContainer
All Implemented Interfaces:
eu.europa.esig.dss.pdf.IPdfObjFactory, Serializable, Container

public class PadesContainer extends eu.europa.esig.dss.pdf.pdfbox.PdfBoxDefaultObjectFactory implements Container
Created by Andrei on 17.11.2017.
See Also:
  • Field Details

  • Constructor Details

    • PadesContainer

      public PadesContainer(Configuration configuration, String containerPath)
      Parameters:
      configuration - configuration context
      containerPath - the path of container
  • Method Details

    • addDataFile

      public DataFile addDataFile(String path, String mimeType)
      Description copied from interface: Container
      Adds a data file from the file system to the container.

      Note: Data files can be added to a container only after all signatures have been removed.

      Specified by:
      addDataFile in interface Container
      Parameters:
      path - data file to be added to the container
      mimeType - MIME type of the data file, for example 'text/plain' or 'application/msword'
      Returns:
      data file
    • addDataFile

      public DataFile addDataFile(InputStream is, String fileName, String mimeType)
      Description copied from interface: Container
      Adds a data file from the input stream (i.e. the date file content can be read from the internal memory buffer).

      Note: Data files can be added to a container only after all signatures have been removed.

      Specified by:
      addDataFile in interface Container
      Parameters:
      is - input stream from where data is read
      fileName - data file name in the container
      mimeType - MIME type of the data file, for example 'text/plain' or 'application/msword'
      Returns:
      data file
    • addDataFile

      public DataFile addDataFile(File file, String mimeType)
      Description copied from interface: Container
      Adds a data file from the file system to the container.

      Note: Data files can be added to a container only after all signatures have been removed.

      Specified by:
      addDataFile in interface Container
      Parameters:
      file - data file to be added to the container
      mimeType - MIME type of the data file, for example 'text/plain' or 'application/msword'
      Returns:
      data file
    • addDataFile

      public void addDataFile(DataFile dataFile)
      Description copied from interface: Container
      Adds the specified data file to the container.

      Note: Data files can be added to a container only after all signatures have been removed.

      Specified by:
      addDataFile in interface Container
      Parameters:
      dataFile - data file to be added to the container
    • addSignature

      public void addSignature(Signature signature)
      Description copied from interface: Container
      Adds a new signature to the container.
      Specified by:
      addSignature in interface Container
      Parameters:
      signature - signature to be added.
    • getDataFiles

      public List<DataFile> getDataFiles()
      Description copied from interface: Container
      Returns the list of data files in the container.
      Specified by:
      getDataFiles in interface Container
      Returns:
      list of data files in the container
    • getType

      public String getType()
      Description copied from interface: Container
      Returns the type of the container. The known container types are the following: Custom implementations of this interface may return other custom types.
      Specified by:
      getType in interface Container
      Returns:
      type of the container
    • getSignatures

      public List<Signature> getSignatures()
      Description copied from interface: Container
      Returns the list of signatures in the container.
      Specified by:
      getSignatures in interface Container
      Returns:
      list of signatures in the container
    • removeDataFile

      public void removeDataFile(DataFile file)
      Description copied from interface: Container
      Removes the data file from the container.

      Note: Data files can be removed from a container only after all signatures have been removed.

      Specified by:
      removeDataFile in interface Container
      Parameters:
      file - data file to be removed from the container.
    • removeSignature

      public void removeSignature(Signature signature)
      Description copied from interface: Container
      Removes the signature from the container
      Specified by:
      removeSignature in interface Container
      Parameters:
      signature - signature to be removed.
    • extendSignatureProfile

      public void extendSignatureProfile(SignatureProfile profile)
      Description copied from interface: Container
      Extends profile of all signatures to SignatureProfile
      Specified by:
      extendSignatureProfile in interface Container
      Parameters:
      profile - signature profile
      See Also:
    • extendSignatureProfile

      public void extendSignatureProfile(SignatureProfile profile, List<Signature> signaturesToExtend)
      Description copied from interface: Container
      Extends profile of selected signatures to SignatureProfile
      Specified by:
      extendSignatureProfile in interface Container
      Parameters:
      profile - signature profile
      signaturesToExtend - signatures selected for extension
      See Also:
    • saveAsFile

      public File saveAsFile(String filePath)
      Description copied from interface: Container
      Saves the container to the specified location.
      Specified by:
      saveAsFile in interface Container
      Parameters:
      filePath - file name and path.
    • saveAsStream

      public InputStream saveAsStream()
      Description copied from interface: Container
      Saves the container as a stream.
      Specified by:
      saveAsStream in interface Container
      Returns:
      stream of the container.
    • validate

      public ContainerValidationResult validate()
      Validate pades container
      Specified by:
      validate in interface Container
      Returns:
      ValidationResult
    • addTimestamp

      public void addTimestamp(Timestamp timestamp)
      Description copied from interface: Container
      Adds a new timestamp token covering the contents of this container.
      Specified by:
      addTimestamp in interface Container
      Parameters:
      timestamp - timestamp to add to this container
    • removeTimestamp

      public void removeTimestamp(Timestamp timestamp)
      Description copied from interface: Container
      Removes the specified timestamp token from this container.

      Note: A timestamp token can be removed from a container only if the container does not contain any other timestamp tokens that cover the timestamp token to be removed.

      Specified by:
      removeTimestamp in interface Container
      Parameters:
      timestamp - timestamp token to remove from this container
    • setTimeStampToken

      @Deprecated public void setTimeStampToken(DataFile timeStampToken)
      Deprecated.
      Description copied from interface: Container
      Adds timestamp token
      Specified by:
      setTimeStampToken in interface Container
      Parameters:
      timeStampToken - timestamp token
    • getTimeStampToken

      @Deprecated public DataFile getTimeStampToken()
      Deprecated.
      Description copied from interface: Container
      Returns timestamp token
      Specified by:
      getTimeStampToken in interface Container
      Returns:
      TimestampToken
    • getConfiguration

      public Configuration getConfiguration()
      Description copied from interface: Container
      Gets Configuration
      Specified by:
      getConfiguration in interface Container
      Returns:
      Configuration
    • save

      public void save(OutputStream out)
      Description copied from interface: Container
      Saves the container to the java.io.OutputStream.
      Specified by:
      save in interface Container
      Parameters:
      out - output stream.
      See Also: