dkpro-jwpl
dkpro-jwpl copied to clipboard
Fixes #24 - Automatically delete *.bin files after dump creation process
- Adds a "path/file deletion watch dog" which guarantees to remove files upon JVM shutdown to avoid left behind (intermediate) files
- Adapts the
SimpleBinaryDumpWriter
implementation to register all created*.bin
at theDeleteFilesAtShutdown
monitor - Reduces CnP code by adding helper methods to
SimpleBinaryDumpWriter
@daxenberger / @reckart Please review the changes in this branch I pushed to solve #24.
Note: This needs proper, manual testing as there isn't any JUnit test for this. This should - ideally - be tested on different OSes, i.e. Linux/Windows/MacOS and under OpenJDK/Oracle JDK 8.
Fixes #24 - Automatically delete *.bin files after dump creation process
Why not simply call File.deleteOnExit()
?
I'm not even sure that DumpWriter
should really clean up after itself. What if somebody really just wants to create these files and doesn't want them to get deleted at shutdown? I thing that DumpWriter
should implement some clean-up method which the code that makes use of the DumpWriter
can call at the end. Then the code which makes use of the DumpWriter
should be changed to call this method after it does not need the data produced by the DumpWriter
anymore.
@daxenberger I agree: .bin
files are not of much interest to most (>90%) users. Please specify an optional parameter in the original issue (#24) as a comment. I could then rework the PR to reflect this idea, so users can decide whether to keep the files or not.
Note: this is still in a WIP state. See comments/discussion in #24
I have added a WIP label and marked this PR with it.
thx, that's helpful for other cases as well.
Any updates ?
@tgalery Vietnam..., lack of time. I'll try to make progress with this PR during the next 1 or 2 weeks.