I have created a wrapper class for URLConnections that works nicely on both macOS and Windows.
I can add connections to a control that keeps track of them and fires events based on their upload and the server response download status.
When the fileReceived event fires, I can open the XML, read and process responses, and the control deletes the temporary file.
All great, except for it has stopped working on Windows when I added another download type (type is just a string property of the URLConnection subclass I use).
Because I read somewhere here that using temporary files should be more reliable (but dont know the source and current validity of this statement anymore), I am using downloads into the temp folder. That file for this type (called AccountCheck.txt) arrives (although progress property on Windows is Infinity), exists and has valid content when I view it manually.
When I try to open it with a TextInputStream, Windows fires an iOException 32 file is in use by another process , which does not make any sense to me. It are exactly the same methods and event handlers that work for every other file reliably. And the filereceived event should return the file free from every possible background thread, shouldnt it?
Any hints why this could fail? Thanks a lot!