mirror of https://github.com/apache/poi.git
try to fix temp file docs
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1922789 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
75729edcea
commit
018961ea77
|
@ -32,8 +32,8 @@ import java.util.concurrent.locks.ReentrantLock;
|
||||||
* Default implementation of the {@link TempFileCreationStrategy} used by {@link TempFile}:
|
* Default implementation of the {@link TempFileCreationStrategy} used by {@link TempFile}:
|
||||||
* Files are collected into one directory.
|
* Files are collected into one directory.
|
||||||
* Files may be manually deleted by user prior to JVM exit.
|
* Files may be manually deleted by user prior to JVM exit.
|
||||||
* You can define the system property {@link #DELETE_FILES_ON_EXIT} and set to true if you want to
|
* You can define the system property {@link #DELETE_FILES_ON_EXIT} if you want to
|
||||||
* delete any stray files on clean JVM exit.
|
* delete any stray files on clean JVM exit (any non-empty value means add the deleteOnExit flag).
|
||||||
*
|
*
|
||||||
* The POI code should tidy up temp files when it no longer needs them.
|
* The POI code should tidy up temp files when it no longer needs them.
|
||||||
* The temporary directory is not deleted after the JVM exits.
|
* The temporary directory is not deleted after the JVM exits.
|
||||||
|
@ -83,8 +83,8 @@ public class DefaultTempFileCreationStrategy implements TempFileCreationStrategy
|
||||||
// Generate a unique new filename
|
// Generate a unique new filename
|
||||||
File newFile = Files.createTempFile(dir.toPath(), prefix, suffix).toFile();
|
File newFile = Files.createTempFile(dir.toPath(), prefix, suffix).toFile();
|
||||||
|
|
||||||
// Set the delete on exit flag if requested
|
// Set the delete on exit flag if sys prop is set
|
||||||
if (Boolean.getBoolean(DELETE_FILES_ON_EXIT)) {
|
if (System.getProperty(DELETE_FILES_ON_EXIT) != null) {
|
||||||
newFile.deleteOnExit();
|
newFile.deleteOnExit();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue