https://bz.apache.org/bugzilla/show_bug.cgi?id=61138
--- Comment #2 from Javen O'Neal <[email protected]> --- (In reply to Charles FENDT from comment #0) > The DefaultTempFileCreationStrategy creates a sub directory in the TEMP > directory of the system Check out o.a.p.util.TempFile#setTempFileCreationStrategy method so that you can plug in your own temporary file creation strategy to meet your needs by implementing your own TempFileCreationStrategy class, as you've done here (hopefully not modifying the DefaultTempFileCreationStrategy class, unless you want to maintain a private fork). There have been a few other bugs and requests on the dev mailing list for providing more strategies, such as process-specific or thread-specific directories, fixed-size/auto-pruning directories, and directories cleaned up on a timer or from an explicit call rather than at JVM exit (for long-running JVM server processes), encrypted temp files, a common folder shared among multiple processes, with each process deleting its temp files at exit, and the last process deleting the temp directory. I think the documentation mentions this, but maybe not prominently enough. DefaultTempFileCreationStrategy.java: > * See {@link TempFileCreationStrategy} for better strategies for long-running > * processes or limited temporary storage. And a few strategies talked about, but not implemented, in the TempFileCreationStrategy interface: [1] At this point the strategies are too specific to a user's needs and the interface is small enough to easily implement that we haven't felt the need to add these to the POI API yet. If you want to develop some other TempFileCreationStrategies that you think would be universally usable (platform-independent), simple to use, and simple for us to maintain, and agnostic of filesystems and internationalization, then feel free to contribute a patch or pull request with unit tests. Ask if you need help. In your example below, the user.name property may not exist, may contain characters that are not allowed in a file path (backslash and colon come to mind, though many other symbols and unicode could break on some file systems). (In reply to Charles FENDT from comment #1) > Line 128, i found a FIXME : > // FIXME: Java 7+: use java.nio.Files#createTempDirectory Thanks. Apache POI still officially supports Java 6 in source and binary, so this FIXME stays in until we officially drop support for Java 6. We should probably have a decorator or a consistent comment string that could be searched on to find all the code that could be written more concisely in Java 7. I'm sure this isn't the only Java 7 fixme. Ask around on the dev mailing list [2] or IRC channel [3] if you want to get involved with POI. [1] https://poi.apache.org/apidocs/org/apache/poi/util/TempFileCreationStrategy.html [2] http://poi.apache.org/mailinglists.html#The+POI+Developer+List [3] https://poi.apache.org/mailinglists.html#IRC -- You are receiving this mail because: You are the assignee for the bug. --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
