Package org.digidoc4j.impl.ddoc
Class DDocContainer
java.lang.Object
org.digidoc4j.impl.ddoc.DDocContainer
- All Implemented Interfaces:
Serializable
,Container
Offers functionality for handling DDoc containers.
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.digidoc4j.Container
Container.DocumentType
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaddDataFile
(File file, String mimeType) Adds a data file from the file system to the container.addDataFile
(InputStream is, String fileName, String mimeType) Adds a data file from the input stream (i.e. the date file content can be read from the internal memory buffer).addDataFile
(String path, String mimeType) Adds a data file from the file system to the container.void
addDataFile
(DataFile dataFile) Adds the specified data file to the container.void
addSignature
(Signature signature) Adds a new signature to the container.void
addTimestamp
(Timestamp timestamp) Adds a new timestamp token covering the contents of this container.void
extendSignatureProfile
(SignatureProfile profile) Extends profile of all signatures to SignatureProfilevoid
extendSignatureProfile
(SignatureProfile profile, List<Signature> signaturesToExtend) Extends profile of selected signatures to SignatureProfileGets ConfigurationReturns the list of data files in the container.This method returns Returns DDocFacade.Returns ddoc formatReturns the list of signatures in the container.Deprecated.getType()
Returns container type "DDOC"void
removeDataFile
(DataFile file) Removes the data file from the container.void
removeSignature
(Signature signature) Removes the signature from the containervoid
removeTimestamp
(Timestamp timestamp) Removes the specified timestamp token from this container.void
save
(OutputStream out) Saves the container to the java.io.OutputStream.saveAsFile
(String fileName) Saves the container to the specified location.Saves the container as a stream.void
setTimeStampToken
(DataFile timeStampToken) Deprecated.validate()
Validate containerMethods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.digidoc4j.Container
getTimestamps
-
Constructor Details
-
DDocContainer
DDocContainer constructor.- Parameters:
ddoc4jFacade
-
-
-
Method Details
-
addDataFile
Description copied from interface:Container
Adds a data file from the file system to the container.Note: Data files can be added to a container only after all signatures have been removed.
- Specified by:
addDataFile
in interfaceContainer
- Parameters:
path
- data file to be added to the containermimeType
- MIME type of the data file, for example 'text/plain' or 'application/msword'- Returns:
- data file
-
addDataFile
Description copied from interface:Container
Adds a data file from the input stream (i.e. the date file content can be read from the internal memory buffer).Note: Data files can be added to a container only after all signatures have been removed.
- Specified by:
addDataFile
in interfaceContainer
- Parameters:
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'- Returns:
- data file
-
addDataFile
Description copied from interface:Container
Adds a data file from the file system to the container.Note: Data files can be added to a container only after all signatures have been removed.
- Specified by:
addDataFile
in interfaceContainer
- Parameters:
file
- data file to be added to the containermimeType
- MIME type of the data file, for example 'text/plain' or 'application/msword'- Returns:
- data file
-
addDataFile
Description copied from interface:Container
Adds the specified data file to the container.Note: Data files can be added to a container only after all signatures have been removed.
- Specified by:
addDataFile
in interfaceContainer
- Parameters:
dataFile
- data file to be added to the container
-
addSignature
Description copied from interface:Container
Adds a new signature to the container.- Specified by:
addSignature
in interfaceContainer
- Parameters:
signature
- signature to be added.
-
getDataFiles
Description copied from interface:Container
Returns the list of data files in the container.- Specified by:
getDataFiles
in interfaceContainer
- Returns:
- list of data files in the container
-
getType
Returns container type "DDOC" -
getSignatures
Description copied from interface:Container
Returns the list of signatures in the container.- Specified by:
getSignatures
in interfaceContainer
- Returns:
- list of signatures in the container
-
removeDataFile
Description copied from interface:Container
Removes the data file from the container.Note: Data files can be removed from a container only after all signatures have been removed.
- Specified by:
removeDataFile
in interfaceContainer
- Parameters:
file
- data file to be removed from the container.
-
removeSignature
Description copied from interface:Container
Removes the signature from the container- Specified by:
removeSignature
in interfaceContainer
- Parameters:
signature
- signature to be removed.
-
extendSignatureProfile
Description copied from interface:Container
Extends profile of all signatures to SignatureProfile- Specified by:
extendSignatureProfile
in interfaceContainer
- Parameters:
profile
- signature profile- See Also:
-
extendSignatureProfile
Description copied from interface:Container
Extends profile of selected signatures to SignatureProfile- Specified by:
extendSignatureProfile
in interfaceContainer
- Parameters:
profile
- signature profilesignaturesToExtend
- signatures selected for extension- See Also:
-
saveAsFile
Description copied from interface:Container
Saves the container to the specified location.- Specified by:
saveAsFile
in interfaceContainer
- Parameters:
fileName
- file name and path.
-
saveAsStream
Description copied from interface:Container
Saves the container as a stream.- Specified by:
saveAsStream
in interfaceContainer
- Returns:
- stream of the container.
-
validate
Description copied from interface:Container
Validate container -
addTimestamp
Description copied from interface:Container
Adds a new timestamp token covering the contents of this container.- Specified by:
addTimestamp
in interfaceContainer
- Parameters:
timestamp
- timestamp to add to this container
-
removeTimestamp
Description copied from interface:Container
Removes the specified timestamp token from this container.Note: A timestamp token can be removed from a container only if the container does not contain any other timestamp tokens that cover the timestamp token to be removed.
- Specified by:
removeTimestamp
in interfaceContainer
- Parameters:
timestamp
- timestamp token to remove from this container
-
setTimeStampToken
Deprecated.Description copied from interface:Container
Adds timestamp token- Specified by:
setTimeStampToken
in interfaceContainer
- Parameters:
timeStampToken
- timestamp token
-
getTimeStampToken
Deprecated.Description copied from interface:Container
Returns timestamp token- Specified by:
getTimeStampToken
in interfaceContainer
- Returns:
- TimestampToken
-
getConfiguration
Description copied from interface:Container
Gets Configuration- Specified by:
getConfiguration
in interfaceContainer
- Returns:
- Configuration
-
save
Saves the container to the java.io.OutputStream. -
getDDoc4JFacade
This method returns Returns DDocFacade. DDocFacade for handling data files and signatures in a container.- Returns:
- DDocFacade.
-
getFormat
Returns ddoc format- Returns:
- format as string
-