vertx Core: Source AsyncFile shall be closed after pipe?

13 views
Skip to first unread message

David P

unread,
Jun 23, 2022, 11:06:22 AMJun 23
to vert.x
Hello,

My code pipe a Source Zip File  to Http response Stream using the pipeto() helper as described in Vert.x Core doc (https://vertx.io/docs/vertx-core/java/#_using_asyncfile_as_readstream_and_writestream)


After piping, the source file can no longer be open on Windows with7-zip
(error is about file is still in use by another process).

Same behavior when Source file is  piped to another Async File.


I 've "fixed" the issue by closing the source file after the pipe execution:
------------------------
  srcFile .pipeTo(destFile).toCompletionStage()
               .thenCompose(v -> srcFile.close().toCompletionStage())
-------------------------------

Is it the expected behavior (close src file after pipe)?
If yes, why  it is not indicated in the Core documentation?

Thanks
David


 

Thomas SEGISMONT

unread,
Jun 28, 2022, 4:57:51 AMJun 28
to ve...@googlegroups.com
Right, it's the expected behavior. I'll fix the documentation. Thanks for reporting the issue.

--
You received this message because you are subscribed to the Google Groups "vert.x" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vertx+un...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/vertx/cc9b4ff5-4fe3-41e6-be5e-95a1ffd1ed74n%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages