- All Superinterfaces:
Serializable
- All Known Implementing Classes:
CommonDocument,DigestDocument,FileDocument,InMemoryDocument
Interface representing a DSS document.
-
Method Summary
Modifier and TypeMethodDescriptiongetDigest(eu.europa.esig.dss.enumerations.DigestAlgorithm digestAlgorithm) This method returns the digest value of the currentDSSDocumentusing the base64 algorithm.byte[]getDigestValue(eu.europa.esig.dss.enumerations.DigestAlgorithm digestAlgorithm) This method returns digest value of the current document's content using the provideddigestAlgorithmeu.europa.esig.dss.enumerations.MimeTypeReturns the mime-type of theDSSDocument.getName()Returns the name of the document.Opens aInputStreamon theDSSDocumentcontents.voidSave the content of the DSSDocument to the file.voidsetMimeType(eu.europa.esig.dss.enumerations.MimeType mimeType) This method sets the mime-type of theDSSDocument.voidThis method sets the name of theDSSDocument.voidwriteTo(OutputStream stream) Writes the content of the document to the provided OutputStream
-
Method Details
-
openStream
InputStream openStream()Opens aInputStreamon theDSSDocumentcontents. The type of theInputStreamdepends 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 theDSSDocumentwas built based on theFilethen the file name is returned.- Returns:
Stringrepresenting the name of the currentDSSDocument
-
setName
This method sets the name of theDSSDocument.- Parameters:
name- the document name
-
getMimeType
eu.europa.esig.dss.enumerations.MimeType getMimeType()Returns the mime-type of theDSSDocument.- Returns:
MimeType
-
setMimeType
void setMimeType(eu.europa.esig.dss.enumerations.MimeType mimeType) 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 digest value of the currentDSSDocumentusing the base64 algorithm.- Parameters:
digestAlgorithm-DigestAlgorithm- Returns:
Digest
-
getDigestValue
byte[] getDigestValue(eu.europa.esig.dss.enumerations.DigestAlgorithm digestAlgorithm) This method returns digest value of the current document's content using the provideddigestAlgorithm- Parameters:
digestAlgorithm-DigestAlgorithmto get digest for- Returns:
- byte array representing digest of the document
-