Package eu.europa.esig.dss.model
Interface DSSDocument
-
- All Superinterfaces:
Serializable
- All Known Implementing Classes:
CMSSignedDocument,CommonDocument,DigestDocument,FileDocument,InMemoryDocument
public interface DSSDocument extends Serializable
Interface representing a DSS document.
-
-
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.InputStreamopenStream()Opens aInputStreamon theDSSDocumentcontents.voidsave(String filePath)Save the content of the DSSDocument to the file.voidsetMimeType(MimeType mimeType)This method sets the mime-type of theDSSDocument.voidsetName(String name)This method sets the name of theDSSDocument.voidwriteTo(OutputStream stream)Writes the content of the document to the provided OutputStream
-
-
-
Method Detail
-
openStream
InputStream openStream()
Opens aInputStreamon theDSSDocumentcontents. The type of theInputStreamdepends on the type of theDSSDocument.- Returns:
- an
InputStream
-
writeTo
void writeTo(OutputStream stream) throws IOException
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
void setName(String name)
This method sets the name of theDSSDocument.- Parameters:
name- the document name
-
getAbsolutePath
String getAbsolutePath()
Returns theStringrepresenting the absolute path to the encapsulated document.- Returns:
Stringrepresenting the absolute path to the encapsulated document.
-
getMimeType
MimeType getMimeType()
Returns the mime-type of theDSSDocument.- Returns:
MimeType
-
setMimeType
void setMimeType(MimeType mimeType)
This method sets the mime-type of theDSSDocument.- Parameters:
mimeType-MimeType
-
save
void save(String filePath) throws IOException
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
String getDigest(DigestAlgorithm digestAlgorithm)
This method returns the encoded digest value of the currentDSSDocumentusing the base64 algorithm.- Parameters:
digestAlgorithm-DigestAlgorithm- Returns:
- base64 encoded
String
-
-