org.apache.poi.util
Interface TempFileCreationStrategy

All Known Implementing Classes:
DefaultTempFileCreationStrategy, TempFile.DefaultTempFileCreationStrategy

public interface TempFileCreationStrategy

Interface used by the TempFile utility class to create temporary files. Classes that implement a TempFileCreationStrategy attempt to handle the cleanup of temporary files. Examples include:


Method Summary
 java.io.File createTempDirectory(java.lang.String prefix)
          Creates a new and empty temporary directory.
 java.io.File createTempFile(java.lang.String prefix, java.lang.String suffix)
          Creates a new and empty temporary file.
 

Method Detail

createTempFile

java.io.File createTempFile(java.lang.String prefix,
                            java.lang.String suffix)
                            throws java.io.IOException
Creates a new and empty temporary file.

Parameters:
prefix - The prefix to be used to generate the name of the temporary file.
suffix - The suffix to be used to generate the name of the temporary file.
Returns:
The path to the newly created and empty temporary file.
Throws:
java.io.IOException - If no temporary file could be created.

createTempDirectory

java.io.File createTempDirectory(java.lang.String prefix)
                                 throws java.io.IOException
Creates a new and empty temporary directory.

Parameters:
prefix - The directory name to be used to generate the name of the temporary directory.
Returns:
The path to the newly created and empty temporary directory.
Throws:
java.io.IOException - If no temporary directory could be created.
Since:
POI 3.15 beta 3.