public interface Container extends Serializable
A container can contain several files and all those files can be signed using signing certificates. A container can only be signed if it contains data files.
Data files can be added and removed from a container only if the container is not signed. To modify the data list of a signed container by adding or removing datafiles you must first remove all the signatures.
Modifier and Type | Interface and Description |
---|---|
static class |
Container.DocumentType
Document types
|
Modifier and Type | Method and Description |
---|---|
void |
addDataFile(DataFile dataFile)
Adds a data file from the file system to the container.
|
DataFile |
addDataFile(File file,
String mimeType)
Adds a data file from the file system to the container.
|
DataFile |
addDataFile(InputStream is,
String fileName,
String mimeType)
Adds a data file from the input stream (i.e.
|
DataFile |
addDataFile(String path,
String mimeType)
Adds a data file from the file system to the container.
|
void |
addSignature(Signature signature)
Adds a new signature to the container.
|
void |
extendSignatureProfile(SignatureProfile profile)
Extends signature profile to SignatureProfile
|
Configuration |
getConfiguration()
Gets Configuration
|
List<DataFile> |
getDataFiles()
Returns all data files in the container.
|
List<Signature> |
getSignatures()
Returns a list of all signatures in the container.
|
DataFile |
getTimeStampToken()
Returns timestamp token
|
String |
getType()
Returns container type "BDOC" or "DDOC"
|
void |
removeDataFile(DataFile file)
Removes the data file from the container.
|
void |
removeSignature(Signature signature)
Removes the signature from the container
|
void |
save(OutputStream out)
Saves the container to the java.io.OutputStream.
|
File |
saveAsFile(String filePath)
Saves the container to the specified location.
|
InputStream |
saveAsStream()
Saves the container as a stream.
|
void |
setTimeStampToken(DataFile timeStampToken)
Deprecated.
Deprecated for removal
|
ContainerValidationResult |
validate()
Validate container
|
DataFile addDataFile(String path, String mimeType)
Note: Data files can be removed from a container only after all signatures have been removed.
path
- data file to be added to the containermimeType
- MIME type of the data file, for example 'text/plain' or 'application/msword'DataFile addDataFile(InputStream is, String fileName, String mimeType)
Note: Data files can be added to a container only after all signatures have been removed.
is
- input stream from where data is readfileName
- data file name in the containermimeType
- MIME type of the data file, for example 'text/plain' or 'application/msword'DataFile addDataFile(File file, String mimeType)
Note: Data files can be removed from a container only after all signatures have been removed.
file
- data file to be added to the containermimeType
- MIME type of the data file, for example 'text/plain' or 'application/msword'void addDataFile(DataFile dataFile)
Note: Data files can be removed from a container only after all signatures have been removed.
dataFile
- data file to be added to the containervoid addSignature(Signature signature)
signature
- signature to be added.List<DataFile> getDataFiles()
String getType()
List<Signature> getSignatures()
void removeDataFile(DataFile file)
Note: Data files can be removed from a container only after all signatures have been removed.
file
- data file to be removed from the container.void removeSignature(Signature signature)
signature
- signature to be removed.void extendSignatureProfile(SignatureProfile profile)
profile
- signature profileSignatureProfile
File saveAsFile(String filePath)
filePath
- file name and path.InputStream saveAsStream()
void save(OutputStream out)
out
- output stream.OutputStream
ContainerValidationResult validate()
@Deprecated void setTimeStampToken(DataFile timeStampToken)
timeStampToken
- timestamp tokenDataFile getTimeStampToken()
Configuration getConfiguration()
Copyright © 2023. All rights reserved.