Package eu.europa.esig.dss.model
Class CommonDocument
java.lang.Object
eu.europa.esig.dss.model.CommonDocument
- All Implemented Interfaces:
DSSDocument
,Serializable
- Direct Known Subclasses:
CMSSignedDocument
,ContainerEntryDocument
,DigestDocument
,DocumentWithSha2
,FileArchiveEntry
,FileDocument
,InMemoryDocument
,PdfByteRangeDocument
This class implements the default methods.
- See Also:
-
Field Summary
-
Constructor Summary
ModifierConstructorDescriptionprotected
Default constructor instantiating object with null values and empty digest map -
Method Summary
Modifier and TypeMethodDescriptiongetDigest
(DigestAlgorithm digestAlgorithm) Deprecated.byte[]
getDigestValue
(DigestAlgorithm digestAlgorithm) This method returns digest value of the current document's content using the provideddigestAlgorithm
Returns the mime-type of theDSSDocument
.getName()
Returns the name of the document.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
.toString()
void
writeTo
(OutputStream stream) Writes the content of the document to the provided OutputStreamMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface eu.europa.esig.dss.model.DSSDocument
openStream
-
Field Details
-
digestMap
Cached map of DigestAlgorithms and the corresponding digests for the document -
mimeType
The MimeType of the document -
name
The document name
-
-
Constructor Details
-
CommonDocument
protected CommonDocument()Default constructor instantiating object with null values and empty digest map
-
-
Method Details
-
save
Description copied from interface:DSSDocument
Save the content of the DSSDocument to the file.- Specified by:
save
in interfaceDSSDocument
- Parameters:
path
- the path to the file to be created- Throws:
IOException
- if any IO error happens
-
writeTo
Description copied from interface:DSSDocument
Writes the content of the document to the provided OutputStream- Specified by:
writeTo
in interfaceDSSDocument
- Parameters:
stream
- the output stream where to write- Throws:
IOException
- if any IO error happens
-
getMimeType
Description copied from interface:DSSDocument
Returns the mime-type of theDSSDocument
.- Specified by:
getMimeType
in interfaceDSSDocument
- Returns:
MimeType
-
setMimeType
Description copied from interface:DSSDocument
This method sets the mime-type of theDSSDocument
.- Specified by:
setMimeType
in interfaceDSSDocument
- Parameters:
mimeType
-MimeType
-
getName
Description copied from interface:DSSDocument
Returns the name of the document. If theDSSDocument
was built based on theFile
then the file name is returned.- Specified by:
getName
in interfaceDSSDocument
- Returns:
String
representing the name of the currentDSSDocument
-
setName
Description copied from interface:DSSDocument
This method sets the name of theDSSDocument
.- Specified by:
setName
in interfaceDSSDocument
- Parameters:
name
- the document name
-
getDigest
Deprecated.Description copied from interface:DSSDocument
This method returns the encoded digest value of the currentDSSDocument
using the base64 algorithm.- Specified by:
getDigest
in interfaceDSSDocument
- Parameters:
digestAlgorithm
-DigestAlgorithm
- Returns:
- base64 encoded
String
-
getDigestValue
Description copied from interface:DSSDocument
This method returns digest value of the current document's content using the provideddigestAlgorithm
- Specified by:
getDigestValue
in interfaceDSSDocument
- Parameters:
digestAlgorithm
-DigestAlgorithm
to get digest for- Returns:
- byte array representing digest of the document
-
toString
-