Monday, June 12, 2017

Re: Usage of file handles/file streams in GWT source code

Moving discussion to GWT Contrib:

On Sunday, June 11, 2017 at 9:35:30 PM UTC+2, wrote:
Reading and writing of files should only be done using try-with-resources. This might not be an issue on Linux, but it is a serious issue on Windows where I repeatedly get conflicts with GWT DevMode server not releasing file handles, ie. resulting in situations where it cannot even read its own cache files.

One example: Output.openSourceFile returns a file input stream. SourceHandler.makeSourcePage then does

return Responses.newBinaryStreamResponse("text/plain", pageBytes);

where it eventually might get closed if no error happens... and on top of that the stream is kept open as long as the client wishes to stall reading the response data.

I suggest setting up a GWT-internal standard for handling file resources. My recommendation would be to use try-with-resources and processing a file copy that is stored fully in RAM.

You received this message because you are subscribed to the Google Groups "GWT Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to
To post to this group, send email to
Visit this group at
For more options, visit

No comments:

Post a Comment