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

--- Comment #2 from Attila Kelemen <attila.keleme...@gmail.com> ---
I think POI's mistaken assumption here is that what uses tmp files and what
doesn't is an implementation detail, but tmp file usage has very important
implications (mainly security and quota) to be just treated as such.

Thread locals do not solve the issue, because when I have a module who knows
where to put temporary files generated for particular documents, it cannot
encapsulate POI (as it doesn't know who else might be using POI independently).

Though I have other problems using thread locals as well, the rest (what I'm
aware of) can be solved with some performance loss (not too bad probably).

If you are really against passing around the strategy, then as a middle ground,
if  I could do this:

```
TempFile.withTempStrategy(myStrategy, () -> {
  // Use POI.
});
```

and then POI would promise me that every POI calls within the scope of the
lambda will use `myStrategy`, then that I would consider as a solution to my
main issue.

If you think this would be an acceptable on your part, then I can implement
this instead of my current PR.

-- 
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