Package eu.europa.esig.dss.model
Interface DSSDocument
- All Superinterfaces:
Serializable
- All Known Subinterfaces:
DSSZipEntryDocument
- All Known Implementing Classes:
CMSSignedDocument
,CommonDocument
,ContainerEntryDocument
,DigestDocument
,FileArchiveEntry
,FileDocument
,HTTPHeader
,HTTPHeaderDigest
,InMemoryDocument
,PdfByteRangeDocument
Interface representing a DSS document.
-
Method Summary
Modifier and TypeMethodDescriptiongetDigest
(DigestAlgorithm digestAlgorithm) This method returns the encoded digest value of the currentDSSDocument
using the base64 algorithm.Returns the mime-type of theDSSDocument
.getName()
Returns the name of the document.Opens aInputStream
on theDSSDocument
contents.void
Save the content of the DSSDocument to the file.void
setMimeType
(MimeType mimeType) This method sets the mime-type of theDSSDocument
.void
This method sets the name of theDSSDocument
.void
writeTo
(OutputStream stream) Writes the content of the document to the provided OutputStream
-
Method Details
-
openStream
InputStream openStream()Opens aInputStream
on theDSSDocument
contents. The type of theInputStream
depends on the type of theDSSDocument
.- Returns:
- an
InputStream
-
writeTo
Writes the content of the document to the provided OutputStream- Parameters:
stream
- the output stream where to write- Throws:
IOException
- if any IO error happens
-
getName
String getName()Returns the name of the document. If theDSSDocument
was built based on theFile
then the file name is returned.- Returns:
String
representing the name of the currentDSSDocument
-
setName
This method sets the name of theDSSDocument
.- Parameters:
name
- the document name
-
getMimeType
MimeType getMimeType()Returns the mime-type of theDSSDocument
.- Returns:
MimeType
-
setMimeType
This method sets the mime-type of theDSSDocument
.- Parameters:
mimeType
-MimeType
-
save
Save the content of the DSSDocument to the file.- Parameters:
filePath
- the path to the file to be created- Throws:
IOException
- if any IO error happens
-
getDigest
This method returns the encoded digest value of the currentDSSDocument
using the base64 algorithm.- Parameters:
digestAlgorithm
-DigestAlgorithm
- Returns:
- base64 encoded
String
-