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
,FileArchiveEntry
,FileDocument
,InMemoryDocument
,PdfByteRangeDocument
This class implements the default methods.
- See Also:
-
Field Summary
Modifier and TypeFieldDescriptionprotected EnumMap<DigestAlgorithm,
String> Cached map of DigestAlgorithms and the corresponding digests for the documentprotected MimeType
The MimeType of the documentprotected String
The document name -
Constructor Summary
ModifierConstructorDescriptionprotected
Default constructor instantiating object with null values and empty digest map -
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.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
-
base64EncodeDigestMap
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
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
-
toString
-