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
Fields -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedDefault 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 provideddigestAlgorithmReturns the mime-type of theDSSDocument.getName()Returns the name of the document.voidSave the content of the DSSDocument to the file.voidsetMimeType(MimeType mimeType) This method sets the mime-type of theDSSDocument.voidThis method sets the name of theDSSDocument.toString()voidwriteTo(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, waitMethods 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:DSSDocumentSave the content of the DSSDocument to the file.- Specified by:
savein interfaceDSSDocument- Parameters:
path- the path to the file to be created- Throws:
IOException- if any IO error happens
-
writeTo
Description copied from interface:DSSDocumentWrites the content of the document to the provided OutputStream- Specified by:
writeToin interfaceDSSDocument- Parameters:
stream- the output stream where to write- Throws:
IOException- if any IO error happens
-
getMimeType
Description copied from interface:DSSDocumentReturns the mime-type of theDSSDocument.- Specified by:
getMimeTypein interfaceDSSDocument- Returns:
MimeType
-
setMimeType
Description copied from interface:DSSDocumentThis method sets the mime-type of theDSSDocument.- Specified by:
setMimeTypein interfaceDSSDocument- Parameters:
mimeType-MimeType
-
getName
Description copied from interface:DSSDocumentReturns the name of the document. If theDSSDocumentwas built based on theFilethen the file name is returned.- Specified by:
getNamein interfaceDSSDocument- Returns:
Stringrepresenting the name of the currentDSSDocument
-
setName
Description copied from interface:DSSDocumentThis method sets the name of theDSSDocument.- Specified by:
setNamein interfaceDSSDocument- Parameters:
name- the document name
-
getDigest
Deprecated.Description copied from interface:DSSDocumentThis method returns the encoded digest value of the currentDSSDocumentusing the base64 algorithm.- Specified by:
getDigestin interfaceDSSDocument- Parameters:
digestAlgorithm-DigestAlgorithm- Returns:
- base64 encoded
String
-
getDigestValue
Description copied from interface:DSSDocumentThis method returns digest value of the current document's content using the provideddigestAlgorithm- Specified by:
getDigestValuein interfaceDSSDocument- Parameters:
digestAlgorithm-DigestAlgorithmto get digest for- Returns:
- byte array representing digest of the document
-
toString
-