GroupDocs.Viewer allows you to control a way temporary files and directories is created. Follow these steps to implement custom logic for creating temporary files and folders:
Create a class that implements the com.groupdocs.viewer.common.tempfiles.TemporaryFileManager interface and its methods:
Now GroupDocs.Viewer uses this implementation for creating temporary files and directories.
Use the implementation for your needs as follows:
finalTemporaryFileManagertemporaryFileManager=TemporaryFileManagerFactory.getInstance();finalPathtempFile=temporaryFileManager.createTempFile("temp.txt");// Do something with the file
temporaryFileManager.delete(tempFile);
Note
Default implementation creates the temporary files and directories in a directory specified by the java.io.tmpdir property.
Was this page helpful?
Any additional feedback you'd like to share with us?
Please tell us how we can improve this page.
Thank you for your feedback!
We value your opinion. Your feedback will help us improve our documentation.