https://bz.apache.org/bugzilla/show_bug.cgi?id=69714

PJ Fanning <fannin...@yahoo.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 OS|                            |All

--- Comment #1 from PJ Fanning <fannin...@yahoo.com> ---
I am against this change. We made the temp file management POI pluggable so
that we wouldn't need to worry about having special API methods passing around
strategy instances.

I think it is possible to use POI as is to achieve this requirement.
1. Write a custom global strategy that checks uses a ThreadLocal to get the
local strategy.
2. Register the custom global strategy with POI TempFile class.
3. In a scenario like wanting to create an SXSSFWorkbook and write it out
(which creates a number of temp files), you could update your ThreadLocal to
register to the temp file strategy for this thread. You can unset the
ThreadLocal setting after you finish.

If you are using more recent versions of Java and want to avoid ThreadLocal,
you could look at using Scoped Values instead.

https://www.baeldung.com/java-20-scoped-values

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@poi.apache.org
For additional commands, e-mail: dev-h...@poi.apache.org

Reply via email to