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,DigestDocument,FileDocument,InMemoryDocument
public abstract class CommonDocument extends Object implements DSSDocument
This class implements the default methods.- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected StringabsolutePathprotected EnumMap<DigestAlgorithm,String>base64EncodeDigestMapprotected MimeTypemimeTypeprotected Stringname
-
Constructor Summary
Constructors Constructor Description CommonDocument()
-
Method Summary
Modifier and Type Method Description StringgetAbsolutePath()Returns theStringrepresenting the absolute path to the encapsulated document.StringgetDigest(DigestAlgorithm digestAlgorithm)This method returns the encoded digest value of the currentDSSDocumentusing the base64 algorithm.MimeTypegetMimeType()Returns the mime-type of theDSSDocument.StringgetName()Returns the name of the document.voidsave(String path)Save the content of the DSSDocument to the file.voidsetAbsolutePath(String absolutePath)voidsetMimeType(MimeType mimeType)This method sets the mime-type of theDSSDocument.voidsetName(String name)This method sets the name of theDSSDocument.StringtoString()voidwriteTo(OutputStream stream)Writes the content of the document to the provided OutputStream-
Methods 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
-
-
-
-
Method Detail
-
save
public void save(String path) throws IOException
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
public void writeTo(OutputStream stream) throws IOException
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
public MimeType getMimeType()
Description copied from interface:DSSDocumentReturns the mime-type of theDSSDocument.- Specified by:
getMimeTypein interfaceDSSDocument- Returns:
MimeType
-
setMimeType
public void setMimeType(MimeType mimeType)
Description copied from interface:DSSDocumentThis method sets the mime-type of theDSSDocument.- Specified by:
setMimeTypein interfaceDSSDocument- Parameters:
mimeType-MimeType
-
getName
public String 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
public void setName(String name)
Description copied from interface:DSSDocumentThis method sets the name of theDSSDocument.- Specified by:
setNamein interfaceDSSDocument- Parameters:
name- the document name
-
getAbsolutePath
public String getAbsolutePath()
Description copied from interface:DSSDocumentReturns theStringrepresenting the absolute path to the encapsulated document.- Specified by:
getAbsolutePathin interfaceDSSDocument- Returns:
Stringrepresenting the absolute path to the encapsulated document.
-
setAbsolutePath
public void setAbsolutePath(String absolutePath)
-
getDigest
public String getDigest(DigestAlgorithm digestAlgorithm)
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
-
-