Below is a PR with changes in a small module for exporting archive documents. After the changes, the behavior became unstable: some calls return an empty or truncated result, and repeated operations with the same temporary file cause unexpected failures.
export(path: Path): String method must:
path;.txt extension;entryName:content format, joined with \n;export completes, all related resources must be properly released.deleteArchive(path) after a successful export must not depend on previously opened resources.a.txt with the value alphab.bin with the value ignoreddocs/ as a directoryc.txt with the value charlieArchiveExporter.export(...) for this archive.ArchiveExporter.deleteArchive(...) for the same path..txt entries in a row.Example archive preparation on a Unix-like system:
mkdir -p tmp/docs
printf 'alpha' > tmp/a.txt
printf 'ignored' > tmp/b.bin
printf 'charlie' > tmp/c.txt
zip -r sample.zip tmp/a.txt tmp/b.bin tmp/docs tmp/c.txt
export(...) returns the full contents of all matching .txt entries in a single String.export(...) finishes, the archive can be deleted immediately via deleteArchive(...) without errors related to an unclosed ZIP file.3.3.121java.util.zip, java.nio.file)Future and without third-party librariesUse line comments to explain the problem, its impact, the fix and how to test it.