Class TempFileResourcesHandler
java.lang.Object
eu.europa.esig.dss.signature.resources.AbstractResourcesHandler
eu.europa.esig.dss.signature.resources.TempFileResourcesHandler
- All Implemented Interfaces:
DSSResourcesHandler
,Closeable
,AutoCloseable
This resources factory stores temporary documents to a unique file within filesystem.
Removes temporary files on exit, unless they have been used within a
eu.europa.esig.dss.model.FileDocument
.-
Constructor Summary
ConstructorDescriptionTempFileResourcesHandler
(String fileNamePrefix, String fileNameSuffix, File tempFileDirectory) Default constructor -
Method Summary
Modifier and TypeMethodDescriptionprotected OutputStream
BuildsOutputStream
void
close()
void
This method is used to delete the temporary File forcibly, even with a flagtoBeDeleted
set to false.This method creates a newDSSDocument
representing a signed document, based on the createdOutputStream
.Methods inherited from class eu.europa.esig.dss.signature.resources.AbstractResourcesHandler
createOutputStream, getOutputStream
-
Constructor Details
-
TempFileResourcesHandler
-
-
Method Details
-
buildOutputStream
Description copied from class:AbstractResourcesHandler
BuildsOutputStream
- Specified by:
buildOutputStream
in classAbstractResourcesHandler
- Returns:
OutputStream
- Throws:
IOException
- if an error occurs while building OutputStream
-
writeToDSSDocument
Description copied from interface:DSSResourcesHandler
This method creates a newDSSDocument
representing a signed document, based on the createdOutputStream
.- Returns:
DSSDocument
-
close
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Overrides:
close
in classAbstractResourcesHandler
- Throws:
IOException
-
forceDelete
public void forceDelete()This method is used to delete the temporary File forcibly, even with a flagtoBeDeleted
set to false. Method should be called responsively and the temp file should be preserved when needed (e.g. output of signDocument() method).
-